【问题标题】:Shapely Linestring total length匀称的线串总长度
【发布时间】:2021-07-28 02:44:20
【问题描述】:

我刚刚制作了一个带有多个 GPS 坐标点的匀称线串,我想要以米为单位的总长度。

坐标示例:[-0.113623333333333, 44.911787333333336]

我怎样才能做到这一点?

【问题讨论】:

标签: python geopandas shapely


【解决方案1】:

您可以使用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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多