我正在尝试制作 geodjango 应用程序。我正在使用 SQLite 和 SpatialLite。我想添加商店,并能够从离我的位置最近到最远对它们进行排序。
在我的模型中,我有:
location = gis_models.PointField(srid=4326, blank=True, null=True)
然后添加作品,但按距离排序不起作用,我得到:
SQLite does not support linear distance calculations on geodetic coordinate systems.
当我有:
location = gis_models.PointField(srid=3857, blank=True, null=True)
比添加不起作用,排序起作用,我得到:
geo_shop.location violates Geometry constraint [geom-type or SRID not allowed]
我该怎么做才能让它们同时工作?