1
我从谷歌地图方向api计算线串。 我将线串转换为GEOSGeometry对象。我需要另一个区域,它覆盖线串对象距离'd'的所有点。 距离以米,公里为单位。 GEOS API提供了GEOSGeometry.buffer(width,quadsegs = 8),这样做在二维投影中效果很好。计算包含地理坐标的线串的边界框
但是如何为球面模型做到这一点?它与SRID有关吗?
from django.contrib.gis.geos import LineString
from django.contrib.gis.geos import GEOSGeometry
directions = maps_client.directions(source, destination)
overview_polyline = decode_polyline(directions[0]['overview_polyline'])
linestring_obj = LineString(overview_polyline)
# FOR 2-D projection
bounding_box = linestring_obj.buffer(width=100)
# For spherical model
# ???