[postgis-tickets] [PostGIS] #4949: Transform regression for N, E CRS

PostGIS trac at osgeo.org
Mon Jul 12 16:47:17 PDT 2021


#4949: Transform regression for N,E CRS
----------------------+---------------------------
  Reporter:  rcoup    |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.1.3
 Component:  postgis  |    Version:  3.1.x
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by pramsey):

 I can't tell whether your example point is in (northing, easting) order...
 {{{
 'SRID=2193;POINT(1766289 5927325)'
 }}}
 The code as it exists is pretty simple: if the CRS is in geographics (axis
 1 = Latitude) then swap coordinates, otherwise report/ingest coordinates
 in their EPSG order. For EPSG:2193, that order, in the EPSG database, is
 northing,easting.

 Extracting the problem from PostGIS altogether.
 {{{
 cs2cs -v
 Rel. 6.3.3, July 1st, 2020

 echo -36.785298415230315 174.863597538742 | cs2cs EPSG:4326 EPSG:2193

 5927325.00      1766289.00
 }}}
 So, is 1766289 the easting, or the northing? EPSG says that (a) it's the
 easting and (b) it should come *second* in the axis order. Proj does that
 behaviour, and as far as I can tell so does the current state of postgis:
 {{{
 select st_asewkt(st_transform('SRID=4326;POINT(174.863597538742
 -36.785298415230315)'::geometry, 2193));

                   st_asewkt
 ---------------------------------------------
  SRID=2193;POINT(5927325 1766289.0000000002)
 }}}
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4949#comment:2>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list