Django 格式错误的几何字段geojson
我使用的是rest\u framework\u gis GeoFeatureModelSerializer,我想序列化的类中有以下属性:Django 格式错误的几何字段geojson,django,geolocation,django-rest-framework,gis,geojson,Django,Geolocation,Django Rest Framework,Gis,Geojson,我使用的是rest\u framework\u gis GeoFeatureModelSerializer,我想序列化的类中有以下属性: the_geom = models.PointField(('Point'), null=True, blank=True, editable=False) 序列化程序: class Serializer(GeoFeatureModelSerializer): class Meta: model = PointOfInterest
the_geom = models.PointField(('Point'), null=True, blank=True, editable=False)
序列化程序:
class Serializer(GeoFeatureModelSerializer):
class Meta:
model = PointOfInterest
id_field = False
fields = settings.FEATURE_FIELDS_TO_SERIALIZE
geo_field = "the_geom"
问题是返回的geojson字段格式不正确,如下所示:
geometry: "SRID=4326;POINT (-8.3093807187199999 41.4384913111000017)",
您是否已将
rest\u framework\u gis
添加到已安装的应用程序中?