insarlab / MintPy

Miami InSAR time-series software in Python
https://mintpy.readthedocs.io
Other
560 stars 245 forks source link

`utils0.utm2latlon()`: allow coordinates outside of the normal range of a UTM zone #1107

Closed yunjunz closed 9 months ago

yunjunz commented 9 months ago

Description of proposed changes

Reminders

yunjunz commented 9 months ago

Since this is a simple fix, I will just merge the PR.

scottstanie commented 9 months ago

Sorry I didn't 👍 it yesterday! Looks good, especially since it's weird to me that utm decided to raise a value error on the (I think completely arbitrary?) bounds of 1e5 and 1e6... I don't know where those came from, since if you look at e.g. 12N https://epsg.io/32612, it supposed to be used in the range from -108W to -114W. those (100_000, 1_000_000) bounds are from like -106.5W to -114.6W.

Perhaps at some point we could drop utm in favor of just using pyproj if we're using that elsewhere. The speed difference doesn't seem worth it to me- utm seems to convert 1 million points in like 65 milliseconds compared to pyproj running in 130 milliseconds, 🤷

yunjunz commented 9 months ago

I agree with you: having pyproj only, instead of using utm + pyproj, is much nicer. Since our usage of the conversion is so low, the speed does not matter.