如果我能做到这一点:
>>> from django.contrib.gis.geos import GEOSGeometry
>>> from django.contrib.gis.geos import Point
>>> point = GEOSGeometry('POINT(1 5)')
>>> print point
POINT (1.0000000000000000 5.0000000000000000)
为什么我不能这样做:
>>> lat = 1
>>> lon = 5
>>> point = GEOSGeometry('POINT(lat lon)')
GEOS_ERROR: ParseException: Expected number but encountered word: 'lat'
GEOSException: Error encountered checking Geometry returned from GEOS C function "GEOSWKTReader_read_r".
如何使用变量创建 GEOSGeometry 对象?