[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-171-g28bd4bb

git at osgeo.org git at osgeo.org
Fri Apr 30 09:13:27 PDT 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, master has been updated
       via  28bd4bbcffb08c9098e2ecc6b8f17b8945ffec31 (commit)
       via  a82a8e77e741ac3be9d541ef02986630f6301ffd (commit)
      from  c9a654c4ee99352371308f58a449fa0d00471fb8 (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 28bd4bbcffb08c9098e2ecc6b8f17b8945ffec31
Merge: c9a654c a82a8e7
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Apr 30 12:13:04 2021 -0400

    Merge branch 'geos-coordseq-buffer'

diff --cc liblwgeom/lwgeom_geos.c
index 5c95561,7ba4588..a1bed05
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@@ -143,10 -142,13 +143,13 @@@ ptarray_from_GEOSCoordSeq(const GEOSCoo
  	LWDEBUGF(4, " output dimensions: %d", dims);
  
  	pa = ptarray_construct((dims == 3), 0, size);
- 
+ #if POSTGIS_GEOS_VERSION >= 310
+ 	GEOSCoordSeq_copyToBuffer(cs, (double*) pa->serialized_pointlist, (dims == 3), 0);
+ 	return pa;
+ #else
  	for (i = 0; i < size; i++)
  	{
 -#if POSTGIS_GEOS_VERSION < 38
 +#if POSTGIS_GEOS_VERSION < 30800
  		GEOSCoordSeq_getX(cs, i, &(point.x));
  		GEOSCoordSeq_getY(cs, i, &(point.y));
  		if (dims >= 3) GEOSCoordSeq_getZ(cs, i, &(point.z));

commit a82a8e77e741ac3be9d541ef02986630f6301ffd
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Apr 2 21:08:51 2021 -0400

    Improve performance of LWGEOM-GEOS conversion

diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index 647de60..7ba4588 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -142,7 +142,10 @@ ptarray_from_GEOSCoordSeq(const GEOSCoordSequence* cs, uint8_t want3d)
 	LWDEBUGF(4, " output dimensions: %d", dims);
 
 	pa = ptarray_construct((dims == 3), 0, size);
-
+#if POSTGIS_GEOS_VERSION >= 310
+	GEOSCoordSeq_copyToBuffer(cs, (double*) pa->serialized_pointlist, (dims == 3), 0);
+	return pa;
+#else
 	for (i = 0; i < size; i++)
 	{
 #if POSTGIS_GEOS_VERSION < 38
@@ -159,6 +162,7 @@ ptarray_from_GEOSCoordSeq(const GEOSCoordSequence* cs, uint8_t want3d)
 	}
 
 	return pa;
+#endif
 }
 
 /* Return an LWGEOM from a Geometry */
@@ -270,7 +274,18 @@ ptarray_to_GEOSCoordSeq(const POINTARRAY* pa, uint8_t fix_ring)
 		}
 	}
 
-	if (!(sq = GEOSCoordSeq_create(pa->npoints + append_points, dims)))
+#if POSTGIS_GEOS_VERSION >= 310
+	if (append_points == 0) {
+		sq = GEOSCoordSeq_copyFromBuffer((const double*) pa->serialized_pointlist, pa->npoints, FLAGS_GET_Z(pa->flags), FLAGS_GET_M(pa->flags));
+		if (!sq)
+		{
+			lwerror("Error creating GEOS Coordinate Sequence");
+			return NULL;
+		}
+		return sq;
+	}
+#else
+        if (!(sq = GEOSCoordSeq_create(pa->npoints + append_points, dims)))
 	{
 		lwerror("Error creating GEOS Coordinate Sequence");
 		return NULL;
@@ -326,6 +341,7 @@ ptarray_to_GEOSCoordSeq(const POINTARRAY* pa, uint8_t fix_ring)
 	}
 
 	return sq;
+#endif
 }
 
 static inline GEOSGeometry*

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

Summary of changes:
 liblwgeom/lwgeom_geos.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list