Skip to content
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

pyproj Transformer - order of inputs depends on CRS #19

Closed
ericgyounkin opened this issue Oct 30, 2020 · 2 comments
Closed

pyproj Transformer - order of inputs depends on CRS #19

ericgyounkin opened this issue Oct 30, 2020 · 2 comments

Comments

@ericgyounkin
Copy link
Contributor

found order of coordinates in transformer depends on CRS being from proj4 string or EPSG

from pyproj import Transformer, CRS

specifying nad83 10N with pyproj string

manual_crs = CRS.from_proj4('+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83')
georef_transformer = Transformer.from_crs( manual_crs.geodetic_crs, manual_crs)
georef_transformer.transform(40, -120)
Out[5]: (inf, inf)
georef_transformer.transform(-120, 40)
Out[6]: (756099.6479720183, 4432069.056784666)

specifying nad83 10N from epsg

epsg_crs = CRS.from_epsg(26910)
georef_transformer = Transformer.from_crs(epsg_crs.geodetic_crs, epsg_crs)
georef_transformer.transform(40, -120)
Out[9]: (756099.6479720183, 4432069.056784666)
georef_transformer.transform(-120, 40)
Out[10]: (inf, inf)

manual_crs does indeed declare itself equivalent to 26910

manual_crs.to_epsg()
Out[16]: 26910

@ericgyounkin
Copy link
Contributor Author

added temp fix for this in dbf5ab9

@ericgyounkin
Copy link
Contributor Author

Resolved with using the always_xy keyword argument. See 8e68cb5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant