[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.1-7-ga193190

git at osgeo.org git at osgeo.org
Mon Feb 8 14:59:58 PST 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-3.1 has been updated
       via  a1931909dc50e72767f3735f0d60502ef8dd5f97 (commit)
       via  4f6d81f8843914666b00683dcc93b81f6c13635d (commit)
      from  9ab60a647dcba6815d943393622465e1939f9a90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a1931909dc50e72767f3735f0d60502ef8dd5f97
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Feb 8 14:59:52 2021 -0800

    Add news for #4842

diff --git a/NEWS b/NEWS
index cedacf6..60803fb 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PostGIS 3.1.2
   - #4826, postgis_tiger_geocoder Better answers when no zip is provided
            (Regina Obe)
   - #4817, handle more complex compound coordinate dystems (Paul Ramsey)
+  - #4842, Only do axis flips on CRS that have a "Lat" as the first column (Paul Ramsey)
 
 
 PostGIS 3.1.1

commit 4f6d81f8843914666b00683dcc93b81f6c13635d
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Feb 8 14:58:29 2021 -0800

    Only do axis flips on CRS that have a "Lat" as the first column. Otherwise just take the EPSG database order. References #4842, #4748

diff --git a/liblwgeom/lwgeom_transform.c b/liblwgeom/lwgeom_transform.c
index ed7d601..51d9c2d 100644
--- a/liblwgeom/lwgeom_transform.c
+++ b/liblwgeom/lwgeom_transform.c
@@ -277,7 +277,7 @@ proj_crs_is_swapped(const PJ *pj_crs)
 		const char *out_name, *out_abbrev, *out_direction;
 		double out_unit_conv_factor;
 		const char *out_unit_name, *out_unit_auth_name, *out_unit_code;
-		/* Read only first axis, see if it is degrees / north */
+		/* Read only first axis */
 		proj_cs_get_axis_info(NULL,
 				      pj_cs,
 				      0,
@@ -288,13 +288,10 @@ proj_crs_is_swapped(const PJ *pj_crs)
 				      &out_unit_name,
 				      &out_unit_auth_name,
 				      &out_unit_code);
-		if (strcasecmp(out_abbrev, "E") == 0)
-			rv = LW_FALSE;
-		else if (strcasecmp(out_abbrev, "Lat") == 0)
-			rv = LW_TRUE;
-		else if (strcasecmp(out_direction, "north") == 0)
-			rv = LW_TRUE;
-		else if (strcasecmp(out_direction, "south") == 0)
+
+		/* Only swap Lat/Lon systems */
+		/* Use whatever ordering planar systems default to */
+		if (strcasecmp(out_abbrev, "Lat") == 0)
 			rv = LW_TRUE;
 		else
 			rv = LW_FALSE;
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index 6acda49..da3ea27 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1298,7 +1298,9 @@ SELECT '#4670-5', ST_AsEWKT(ST_AddPoint('LINESTRING(0 0, 1 1, 3 3, 4 4)'::geomet
 
 SELECT '#4689', _ST_DistanceTree('POLYGON ((30 10, 40 40, 20 40, 30 10))'::geography, 'POLYGON((81 6,140 35,-70 18,-51 0,-60 -46,106 -6,81 6))');
 
+-- Polar Stereographic Axis order issues
 SELECT '#4748', ST_AsEWKT(ST_Transform(ST_SetSRID(ST_Point(-36.75, -54.25), 4326), 3031),1);
+SELECT '#4842', ST_AsEWKT(ST_Transform(ST_SetSRID(ST_Point(12.572, 66.081), 4326), 3413),1);
 
 SELECT '#4718',
 	round(degrees(
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index bc1f71a..181f22f 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -435,6 +435,7 @@ ERROR:  BOX2D_construct: args can not be empty points
 ERROR:  LWGEOM_addpoint: Invalid offset
 #4689|0
 #4748|SRID=3031;POINT(-2399498.7 3213318.5)
+#4842|SRID=3413;POINT(2218086.2 -1409161.3)
 #4718|270.000|90.000
 #4727|0
 #4796|POLYGON((178632 397744,178738 397769,178745 397741,178749 397742,178752 397727,178748 397726,178759 397684,178699 397669,178694 397691,178646 397680,178632 397744))

-----------------------------------------------------------------------

Summary of changes:
 NEWS                          |  1 +
 liblwgeom/lwgeom_transform.c  | 13 +++++--------
 regress/core/tickets.sql      |  2 ++
 regress/core/tickets_expected |  1 +
 4 files changed, 9 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list