GeoDjango 相当于 ST_GeomFromGeoJson?
GeoDjango equivalent of ST_GeomFromGeoJson?
GeoDjango中的ST_GeomFromGeojson()
是什么?
我正在 GeoDjango 的文档中寻找它,但它的输出格式只有 AsGeoJSON
。这可以使用 annotate
和 serialize
.
来完成
但是如果我想要一个需要返回到 Geom 的 GeoJson 对象怎么办?
用例:
geom_test = Geom.objects.filter(poly__within = [ST_GeomFromGeoJSON(d)])
来自the docs
GEOSGeometry objects may be created in a few ways. The first is to simply instantiate the object on some spatial input – the following are examples of creating the same geometry from WKT, HEX, WKB, and GeoJSON:
# Other stuff I cut out.
pnt = GEOSGeometry('{ "type": "Point", "coordinates": [ 5.000000, 23.000000 ] }') # GeoJSON
所以基本上GEOSGeometry(GeoJSONString)
GeoDjango中的ST_GeomFromGeojson()
是什么?
我正在 GeoDjango 的文档中寻找它,但它的输出格式只有 AsGeoJSON
。这可以使用 annotate
和 serialize
.
但是如果我想要一个需要返回到 Geom 的 GeoJson 对象怎么办?
用例:
geom_test = Geom.objects.filter(poly__within = [ST_GeomFromGeoJSON(d)])
来自the docs
GEOSGeometry objects may be created in a few ways. The first is to simply instantiate the object on some spatial input – the following are examples of creating the same geometry from WKT, HEX, WKB, and GeoJSON:
# Other stuff I cut out. pnt = GEOSGeometry('{ "type": "Point", "coordinates": [ 5.000000, 23.000000 ] }') # GeoJSON
所以基本上GEOSGeometry(GeoJSONString)