0

I'm trying to update some code because lat/lon values are getting flipped (lat ends up in lon column and vice versa) when using Transformer.from_crs.

The line of code that is causing the issue is this, BUT only when f'epsg:{oldEPSG}'="epsg:4326" (so only when we are converting from AND to epsg:4326).

transformer = Transformer.from_crs(f'epsg:{oldEPSG}', "epsg:4326")

I have tried adding the 3rd argument always_xy=True, as suggested in https://github.com/pyproj4/pyproj/issues/510, but get the same result.

We have coordinates with epsg:6491, epsg:26919 and epsg:5646 in our database which don't have their lat/lon flipped after transforming.

I'm not really familiar with working with coordinate, so I'm confused if I need to be figuring out if they have default lat/lon or lon/lat orders (like will epsg:4326, epsg:6491, epsg:26919 and epsg:5646 all be different?).

I guess I'm just wondering why the lat/lon don't get flipped in all cases? If it's just a matter of checking whether the from and to projections are the same, I can do that. I just want to make sure I understand why this is happening in case other projections end up having the same issue.

Thank you!

xanabobana
  • 63
  • 2
  • 16

0 Answers0