python proj utm2wgs wgs2utm

Posted zolty

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python proj utm2wgs wgs2utm相关的知识,希望对你有一定的参考价值。

1.wgs2utm

zone 需要选择

2.utm2wgs

# zolty add v into vtd by udp
from pyproj import Proj, Transformer


# lon,lat = (119.9579946997, 30.5206528196)
def wgs2tm(lon, lat):
    pipeline_str = (
        '+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs'
        '+proj=longlat +datum=WGS84 +no_defs'
    )
    pipe_trans = Transformer.from_pipeline(pipeline_str)
    xt, yt = pipe_trans.transform(lon, lat)
    print("utm no diff: ", xt, yt)
    #  diff
    xt = xt - 785883
    yt = yt - 3380679
    print("utm + diff : ", xt, yt)


def wgs2utm(lon, lat):
    p = Proj(proj='utm', zone=50, ellps='WGS84')
    x, y = p(lon, lat)
    print("utm no diff: ", x, y)


def utm2wgs(x, y):
    p = Proj(proj='utm', zone=50, ellps='WGS84')
    lon, lat = p(x, y, inverse=True)
    print("lon , lat  : ", lon, lat)


if __name__ == '__main__':
    wgs2tm(119.9579946997, 30.5206528196)
    wgs2utm(119.9579946997, 30.5206528196)
    utm2wgs(785883, 3380679)

以上是关于python proj utm2wgs wgs2utm的主要内容,如果未能解决你的问题,请参考以下文章

python proj utm2wgs wgs2utm

python Inf 124 - Proj 2 - view.py

python Inf 124 - Proj 2 - model.py

python 从EPSG查找网站刮各种proj defn

python Inf 124 - Proj 2 - 测试状态,聊天会话,客户端类

如何让 PROJ C++ 识别网格目录?