[PROJ] proj_trans swaps X and Y?

Alan Snow alansnow21 at gmail.com
Wed Mar 10 06:41:51 PST 2021


Info on why things are this way:
https://proj.org/faq.html#why-is-the-axis-ordering-in-proj-not-consistent

To find the axis order information, you need to inspect the CRS to
determine the axis order:
https://pyproj4.github.io/pyproj/stable/examples.html

The PROJ methods needed to inspect the coordinate system of the CRS include:
proj_crs_get_coordinate_system
proj_cs_get_axis_count
proj_cs_get_axis_info

If you want the old behavior, you can use proj_normalize_for_visualization
so it is in the x,y,z order.

Hope this helps,
Alan

On Wed, Mar 10, 2021 at 8:08 AM Matthew Woehlke <mwoehlke.floss at gmail.com>
wrote:

> I'm trying to convert between coordinate systems using
> proj_create_crs_to_crs and proj_trans.
>
> In PROJ 4, coordinates are always in x,y,z (easting, northing, altitude)
> order. I just stuff my coordinates in and read them back, possibly with
> some conversion between degrees and radians, and everything Just Works.
>
> If I try to do this in PROJ 5, it fails. As best as I can tell, lat-lon
> coordinate systems expect input, and provide output, as y, x, z.
>
> Given that all I know is the EPSG, how do I determine the proper order
> in which to provide my inputs and read my outputs?
>
> --
> Matthew
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj
>


-- 
Alan Snow
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20210310/307ac82f/attachment.html>


More information about the PROJ mailing list