[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-765-g494ce4273

git at osgeo.org git at osgeo.org
Sun Apr 17 03:38:51 PDT 2022


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  494ce4273c644fd0cd757dd0b64e41b0505f15a9 (commit)
      from  8ddd39e5edd7906c86d46807a15797c490a2b710 (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 494ce4273c644fd0cd757dd0b64e41b0505f15a9
Author: Aliaksandr Kalenik <kalenik.aliaksandr at gmail.com>
Date:   Fri Apr 15 20:47:20 2022 +0300

    remove GEOS geometry validation from RT_ST_DumpAsPolygons

diff --git a/NEWS b/NEWS
index ba531bd9a..f9143e372 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PostGIS 3.3.0dev
   - Drop support for PostgreSQL 9.6 and 10 (Regina Obe)
   - Change output for WKT MULTIPOINT. All points now
     wrapped in parens. (Even Roualt)
+  - GH674, geometry validation and fixing is disabled for ST_DumpAsPolygons
+    so it works faster but might produce invalid polygons.
 
  * Enhancements *
   - #2861, Add index on topology.node(containing_face) speeding up
diff --git a/raster/rt_core/rt_geometry.c b/raster/rt_core/rt_geometry.c
index b33452ad3..95d5f353c 100644
--- a/raster/rt_core/rt_geometry.c
+++ b/raster/rt_core/rt_geometry.c
@@ -433,9 +433,6 @@ rt_errorstate rt_raster_surface(rt_raster raster, int nband, LWMPOLY **surface)
 		return ES_NONE;
 	}
 
-	/* initialize GEOS */
-	initGEOS(rtinfo, lwgeom_geos_error);
-
 	/* use gdal polygonize */
 	gv = rt_raster_gdal_polygonize(raster, nband, 1, &gvcount);
 	/* no polygons returned */
@@ -1004,11 +1001,6 @@ rt_raster_gdal_polygonize(
 	int iBandHasNodataValue = FALSE;
 	double dBandNoData = 0.0;
 
-	/* for checking that a geometry is valid */
-	GEOSGeometry *ggeom = NULL;
-	int isValid;
-	LWGEOM *lwgeomValid = NULL;
-
 	uint32_t bandNums[1] = {nband};
 	int excludeNodataValues[1] = {exclude_nodata_value};
 
@@ -1261,40 +1253,6 @@ rt_raster_gdal_polygonize(
 		/* specify SRID */
 		lwgeom_set_srid(lwgeom, rt_raster_get_srid(raster));
 
-		/*
-			is geometry valid?
-			if not, try to make valid
-		*/
-		do {
-			ggeom = (GEOSGeometry *) LWGEOM2GEOS(lwgeom, 0);
-			if (ggeom == NULL) {
-				rtwarn("Cannot test geometry for validity");
-				break;
-			}
-
-			isValid = GEOSisValid(ggeom);
-
-			GEOSGeom_destroy(ggeom);
-			ggeom = NULL;
-
-			/* geometry is valid */
-			if (isValid)
-				break;
-
-			RASTER_DEBUG(3, "fixing invalid geometry");
-
-			/* make geometry valid */
-			lwgeomValid = lwgeom_make_valid(lwgeom);
-			if (lwgeomValid == NULL) {
-				rtwarn("Cannot fix invalid geometry");
-				break;
-			}
-
-			lwgeom_free(lwgeom);
-			lwgeom = lwgeomValid;
-		}
-		while (0);
-
 		/* save lwgeom */
 		pols[j].geom = lwgeom_as_lwpoly(lwgeom);
 

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

Summary of changes:
 NEWS                         |  2 ++
 raster/rt_core/rt_geometry.c | 42 ------------------------------------------
 2 files changed, 2 insertions(+), 42 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list