Open m4mlo opened 1 year ago
Are all your points in the same zone? If not, that may be the reason.
See for example https://github.com/Turbo87/utm/blob/master/utm/conversion.py#L291
Hello @bartvanandel ,
You are right, different zones might be the reason why the results are different for an array operation vs. element-wise calculation. Some of my locations are in Australia, some are in Europe. How to overcome the limitation of having latitude and longitude pairs in different zones while being in the same array? Is it necessary to first divide the locations according to the zones. Thanks for your help on this.
At this point, you'll have to split to get accurate results, I'm afraid. Or loop manually.
Note that there are valid reasons for the existing approach. Performance is likely one of them. Note that I've only contributed marginally to this project, I didn't personally write the code I've referred to.
If you think there's a better way thay should be accommodated by this package, you can always create a pull request with your proposed changes or additions.
Hello all, hi @Turbo87, @bartvanandel, @tibnor,
I have around 20M latitude longitude pairs to convert to UTM. While the performance of the conversion utm.from_latlon() is stunning, I noticed some inconsistent results when using utm.from_latlon(lats, lons) on numpy arrays compared to element-wise conversion. The code below should give the same result for result[0] and test_utmx. However, this is not the case (you can run the code if you replace df['Latitude'] and df['Longitude'] by some randomly generated lat lon values). For 100k lat,lon pairs around 100 conversions are wrong when using utm.from_latlon(lats, lons) on a numpy array. Numpy version is '1.21.5', utm-0.7.0
any feedback on this issue would be appreciated.