我刚刚做了一个形状线串与多点的GPS坐标,我想以米为单位的总长度。
坐标示例:-0.113623333333333,44.911787333333336
我怎样才能做到这一点呢?
发布于 2021-07-28 02:44:21
可以使用pyproj测量测地线长度。
>>> from pyproj import Geod
>>> from shapely.geometry import Point, LineString
>>> line_string = LineString([Point(1, 2), Point(3, 4)]))
>>> geod = Geod(ellps="WGS84")
>>> total_length = geod.geometry_length(line_string)
>>> f"{total_length:.3f}"
'313588.397'在文档中查看更多内容:https://pyproj4.github.io/pyproj/stable/examples.html#geodesic-line-length
https://stackoverflow.com/questions/68547631
复制相似问题