Skip to content

What's the difference between using EPSG:4326 and +init=EPSG:4326 for transformer? #1371

Closed Answered by djhoese
zxdawn asked this question in Q&A
Discussion options

You must be logged in to vote

+init= syntax is deprecated. You should get a FutureWarning when using that that looks like this:

/home/davidh/miniconda3/envs/satpy_py312/lib/python3.12/site-packages/pyproj/crs/crs.py:141: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  in_crs_string = _prepare_from_proj_string(in_crs_string)

So flipping the order of the parameters:

In [7]: transformer_wrong.transform(-15.85, -48.15)
Out[7]: (805260.2679547772, 8245581.8793749055)

Or:

In [8]: transformer_better = Transfo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@zxdawn
Comment options

Answer selected by zxdawn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
axis-order Issue related to axis order changes introduced in PROJ 6.
2 participants