且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

lat/lon到utm到lat/lon的漏洞非常严重,怎么来的?

更新时间:2023-02-11 08:07:16

上周,我为Python创建了一个小型的UTM转换库,并将其上传至Python软件包索引:

I've created a small UTM conversion library for Python last week and uploaded it to the Python Package Index: http://pypi.python.org/pypi/utm

我将其与使用pyproj进行了比较,它更快,更准确.给定您的样本数据,结果如下:

I have compared it to using pyproj and it is faster and more accurate. Given your sample data, this is the result:

>>> import utm

>>> u = utm.from_latlon(47.9941214, 7.8509671)
>>> print u
(414278, 5316285, 32, 'T')

>>> print utm.to_latlon(*u)
(47.994157948891505, 7.850963967574302)

更新:以下是Richards 答案,介绍了此问题的真正解决方案.

UPDATE: Richards answer below describes the real solution for this issue.