[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0beta1-1-ga4c1ccb

git at osgeo.org git at osgeo.org
Thu Dec 10 03:34:06 PST 2020


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, master has been updated
       via  a4c1ccbb1f983adf3cdd5e8e8c848d711bd120d6 (commit)
      from  721a0b732c6c96a23e9703d195aadae95760098c (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 a4c1ccbb1f983adf3cdd5e8e8c848d711bd120d6
Author: Sandro Santilli <strk at kbt.io>
Date:   Thu Dec 10 12:26:51 2020 +0100

    Fix GEOS conversion of POINT EMPTY to retain type
    
    References #4815 in master branch

diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index e1e8e6a..10b17e1 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -426,7 +426,7 @@ LWGEOM2GEOS(const LWGEOM* lwgeom, uint8_t autofix)
 		lwp = (LWPOINT*)lwgeom;
 
 		if (lwgeom_is_empty(lwgeom))
-			g = GEOSGeom_createEmptyPolygon();
+			g = GEOSGeom_createEmptyPoint();
 		else
 		{
 #if POSTGIS_GEOS_VERSION < 38
diff --git a/regress/core/geos_noop.sql b/regress/core/geos_noop.sql
new file mode 100644
index 0000000..f38d9f3
--- /dev/null
+++ b/regress/core/geos_noop.sql
@@ -0,0 +1,12 @@
+SELECT
+	--ST_AsEWKT(g),
+	ST_AsEWKT(postgis_geos_noop(g)) FROM ( VALUES
+('SRID=4326;POINT EMPTY'),
+('SRID=4326;MULTIPOINT EMPTY'),
+('SRID=4326;LINESTRING EMPTY'),
+('SRID=4326;MULTILINESTRING EMPTY'),
+('SRID=4326;POLYGON EMPTY'),
+('SRID=4326;MULTIPOLYGON EMPTY'),
+('SRID=4326;GEOMETRYCOLLECTION EMPTY')
+--,('SRID=4326;GEOMETRYCOLLECTION(POINT EMPTY, LINESTRING EMPTY, POLYGON EMPTY, GEOMETRYCOLLECTION EMPTY)')
+) as foo(g);
diff --git a/regress/core/geos_noop_expected b/regress/core/geos_noop_expected
new file mode 100644
index 0000000..843d29f
--- /dev/null
+++ b/regress/core/geos_noop_expected
@@ -0,0 +1,7 @@
+SRID=4326;POINT EMPTY
+SRID=4326;MULTIPOINT EMPTY
+SRID=4326;LINESTRING EMPTY
+SRID=4326;MULTILINESTRING EMPTY
+SRID=4326;POLYGON EMPTY
+SRID=4326;MULTIPOLYGON EMPTY
+SRID=4326;GEOMETRYCOLLECTION EMPTY

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

Summary of changes:
 liblwgeom/lwgeom_geos.c         |  2 +-
 regress/core/geos_noop.sql      | 12 ++++++++++++
 regress/core/geos_noop_expected |  7 +++++++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 regress/core/geos_noop.sql
 create mode 100644 regress/core/geos_noop_expected


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list