======================``GeoJSON`` Serializer======================.. module:: django.contrib.gis.serializers.geojson:synopsis: Serialization of GeoDjango models in the GeoJSON format.GeoDjango provides a specific serializer for the `GeoJSON`__ format. See:doc:`/topics/serialization` for more information on serialization.__ https://geojson.org/The ``geojson`` serializer is not meant for round-tripping data, as it has nodeserializer equivalent. For example, you cannot use :djadmin:`loaddata` toreload the output produced by this serializer. If you plan to reload theoutputted data, use the plain :ref:`json serializer <serialization-formats-json>`instead.In addition to the options of the ``json`` serializer, the ``geojson``serializer accepts the following additional option when it is called by``serializers.serialize()``:* ``geometry_field``: A string containing the name of a geometry field to usefor the ``geometry`` key of the GeoJSON feature. This is only needed when youhave a model with more than one geometry field and you don't want to use thefirst defined geometry field (by default, the first geometry field is picked).* ``srid``: The SRID to use for the ``geometry`` content. Defaults to 4326(WGS 84).The :ref:`fields <subset-of-fields>` option can be used to limit fields thatwill be present in the ``properties`` key, as it works with all otherserializers.Example::from django.core.serializers import serializefrom my_app.models import Cityserialize('geojson', City.objects.all(),geometry_field='point',fields=('name',))Would output::{'type': 'FeatureCollection','crs': {'type': 'name','properties': {'name': 'EPSG:4326'}},'features': [{'type': 'Feature','geometry': {'type': 'Point','coordinates': [-87.650175, 41.850385]},'properties': {'name': 'Chicago'}}]}When the ``fields`` parameter is not specified, the ``geojson`` serializer addsa ``pk`` key to the ``properties`` dictionary with the primary key of theobject as the value.