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

PostGIS trac at osgeo.org
Mon Jul 12 03:55:45 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
 Keywords:           |
---------------------+---------------------------
 #4842 (in v3.1.2) fixed a bug in the behaviour change made in #4748
 (v3.0.3), but has introduced a wider regression.

 in v3.1.1 and earlier (expected):
 {{{
 # SELECT st_asewkt(st_transform('SRID=2193;POINT(1680238
 5863854)'::geometry, 4326));
 SRID=4326;POINT(174.863597538742 -36.785298415230315)
 }}}


 v3.1.2:
 {{{
 # select st_asewkt(st_transform('SRID=2193;POINT(1766289
 5927325)'::geometry, 4326));
 SRID=4326;POINT(-117.47905633499929 -50.9729929889798)
 }}}

 Adding `ST_FlipCoordinates()` returns the right output, so it's definitely
 a CRS Axis Order issue:
 {{{
 # select
 st_asewkt(st_transform(st_flipcoordinates('SRID=2193;POINT(1766289
 5927325)'::geometry), 4326));
 SRID=4326;POINT(174.863597538742 -36.785298415230315)
 }}}


 NZ Transverse Mercator (NZTM) ([https://epsg.io/2193 EPSG:2193]) is
 defined with N, E axis order due to some quirk of history, but it's the
 main CRS used in New Zealand mapping, not an obscure oddball one.

 {{{
 PROJCS["NZGD2000 / New Zealand Transverse Mercator 2000",
     GEOGCS["NZGD2000",
         DATUM["New_Zealand_Geodetic_Datum_2000",
             SPHEROID["GRS 1980", 6378137, 298.257222101, AUTHORITY["EPSG",
 "7019"]],
             TOWGS84[0, 0, 0, 0, 0, 0, 0],
             AUTHORITY["EPSG", "6167"]],
         PRIMEM["Greenwich", 0, AUTHORITY["EPSG", "8901"]],
         UNIT["degree", 0.01745329251994328, AUTHORITY["EPSG", "9122"]],
         AUTHORITY["EPSG", "4167"]],
     UNIT["metre", 1, AUTHORITY["EPSG", "9001"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin", 0],
     PARAMETER["central_meridian", 173],
     PARAMETER["scale_factor", 0.9996],
     PARAMETER["false_easting", 1600000],
     PARAMETER["false_northing", 10000000],
     AUTHORITY["EPSG", "2193"],
     AXIS["Northing", NORTH],
     AXIS["Easting", EAST]]
 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4949>
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