-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inaccuracy of the UTM to/from lat, lon conversion #36
Comments
I also see such inaccurate transformation when comparing utm package with the wheel known osr package https://pcjericks.github.io/py-gdalogr-cookbook/projection.html, |
I also encountered the same issue:
With
|
If you can fix this issue without requiring pyproj, please do. I can install this module under msys2, but I can't install pyproj under msys2. (At least until someone with more experience with me builds it!) |
Similar results with geopy:
|
Apparently PROJ default datum is GRS-80, so
|
Looking the the PROJ documentation. It mentions that the algorithms are given in [Karney2013] and the addenda points to a link of implementations in Python and other languages. Is utm.to_latlon() using this? Maybe geographiclib on PyPi could be incorporated? |
I fixed a bug, see pull #49 this bug may cause in-accuracy mentioned above. |
Now has the following result:
I think this error(~1e-3) is reasonable when using this kind of approximate algorithm. |
and
now gives
|
@chlxt nice! is it available already in the latest version? |
I don't think so, currently It hasn't be approved to merged to the master branch Turbo87/utm, but you can try my fork of utm |
I think this hasn't been merged because the build failed for some older versions of Python for your pull request |
The current implemenation has inaccuracies. See: - Turbo87/utm#36 - Turbo87/utm#49 repro: ``` var utm = require("utm"); var originalLatitude = -33.8688 var originalLongitude = 151.2093 const { easting, northing, zoneNum, zoneLetter} = utm.fromLatLon(originalLatitude,originalLongitude); const { latitude, longitude } = utm.toLatLon(easting, northing, zoneNum, zoneLetter); console.log(latitude, longitude) console.log(`lat/lon delta: ${latitude-originalLatitude}:${longitude-originalLongitude}`) { const { easting: easting2, northing: northing2, zoneNum: zoneNum2, zoneLetter: zoneLetter2} = utm.fromLatLon(latitude,longitude); console.log(`delta: ${easting - easting2}:${northing-northing2}`); } ```
When converting coordinates from UTM to lat, lon then back to UTM with
utm.to_latlon
andutm.from_latlon
you don't end up on the initial point. The error is about 20 to 30 centimeters, depending on the position of the initial point.Running this Python snippet gives:
Any idea on where this might come from?
The text was updated successfully, but these errors were encountered: