美文网首页
geoDjango中‘source and target mus

geoDjango中‘source and target mus

作者: 孤旅行人 | 来源:发表于2018-10-02 17:16 被阅读0次

在使用 django.core.serializers 的serialize函数将数据库里的数据转为geojson格式时,遇见了source and target must be of type SpatialReference的报错。

将model.py中你所使用的表的 geom = models.PointField(srid=0, blank=True, null=True) 中的 srid 改为工程中需要的srid(我这里是4326)即可。

相关文章

网友评论

      本文标题:geoDjango中‘source and target mus

      本文链接:https://www.haomeiwen.com/subject/asnjoftx.html