【问题标题】:Problem converting to consistent UTM when straddling zones跨区域时转换为一致 UTM 的问题
【发布时间】:2019-09-06 19:52:05
【问题描述】:

我需要使用 python 中的 utm 模块在给定纬度/经度位置的情况下获取一组以米为单位的坐标。如果位置跨越不同的区域,则地图将不正确。在检查了一些讨论后,我还没有找到直接的解决方案。

lat_points = [42.827990, 42.849890, 42.824294]
long_points = [95.9, 95.903, 96.01]
xy_meters = [utm.from_latlon(lat,long) for (lat, long) in zip(lat_points,long_points)]
for row in xy_meters:
    print(row)

区域跨越时结果显示差距很大:

(737040.3354880156, 4745793.498913411, 46, 'T')
(737201.7056600684, 4748234.076861802, 46, 'T')
(255588.1599583785, 4745640.325228949, 47, 'T')

【问题讨论】:

    标签: python utm


    【解决方案1】:

    好的,我认为这段代码按预期工作(切换包):

    from pyproj import Proj
    myProj = Proj("+proj=utm +zone=46T, +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
    for lat, long in zip(lat_points,long_points):
        print(myProj(long, lat))
    

    给出想要的:

    (737040.3354579052, 4745793.4987486005)
    (737201.7056297899, 4748234.076696485)
    (746046.8172912733, 4745698.570316798)
    

    【讨论】:

      猜你喜欢
      • 2014-05-29
      • 2014-07-20
      • 2018-02-03
      • 1970-01-01
      • 2012-03-12
      • 2021-12-14
      • 1970-01-01
      • 1970-01-01
      • 2013-04-11
      相关资源
      最近更新 更多