Googleマップの方向APIから折れ線を計算しました。ラインストリングを GEOSGeometry オブジェクトに変換しました。線ストリング オブジェクトから 'd' の距離にあるすべてのポイントをカバーする別の領域が必要です。距離はm、kmです。GEOS API は GEOSGeometry.buffer(width, quadsegs=8) を提供し、2D 投影でうまく機能します。
しかし、球体モデルの場合はどうすればよいでしょうか? それは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
# ???