[SCM] PostGIS branch master updated. 3.6.0rc2-589-g07e64e5f0

git at osgeo.org git at osgeo.org
Thu Jun 18 06:20:06 PDT 2026


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
  discards  c3004485c01808aaedefbf75d6b8de9090739811 (commit)
  discards  b90c3dbb175c92ea3c113c38cacc6a3617a51695 (commit)
  discards  ea9c759b0b8d6c9b27fa5e12c5bb0be8b3405c66 (commit)
  discards  9b9950de1262a24c41e9e4d647627b1816a6ac52 (commit)
  discards  014d02c42befac740f904b1cceca52391b671097 (commit)
  discards  cff529aa81f12c0dc12b2b273a0e836e38c3f122 (commit)
  discards  8c034d0faef7819f920cb4d921068217f679c1cd (commit)
  discards  9cc6dac3d6d9c119667a438118cb4b5b6bb21c3b (commit)
  discards  d078fd9e158e18640e901eed329dca1f0cbc0133 (commit)
  discards  67d6df38c343a8be4605061e330587d9aafaffaf (commit)
       via  07e64e5f0f1361abec66940c45b951d835c5bd1f (commit)
       via  8c5ead8c7e0c3b152929189b8f5e4f00f23525af (commit)
       via  ab211fe67c97b239ff2943e4ead65a71fa0fb012 (commit)
       via  0edc31efc4d80c30801755b91c82297281a35e21 (commit)
       via  5673ac9fdedc6cd309a8b3b6fca0f1a0ad5cc737 (commit)
       via  f1330c340b2d84e93738ea042ee582b003e4d028 (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (c3004485c01808aaedefbf75d6b8de9090739811)
            \
             N -- N -- N (07e64e5f0f1361abec66940c45b951d835c5bd1f)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 07e64e5f0f1361abec66940c45b951d835c5bd1f
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Wed Jun 17 01:16:48 2026 +0400

    Fix signed hex WKB lookup
    
    Cast hex input bytes to uint8_t before indexing the liblwgeom hex lookup table, and cover malformed high-bit WKB input in CUnit.
    
    Closes https://github.com/postgis/postgis/pull/902
    Closes #6080

diff --git a/NEWS b/NEWS
index 6f57e1a8c..6ad9ec024 100644
--- a/NEWS
+++ b/NEWS
@@ -74,6 +74,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
  - #5948, [topology] Prevent MakeTopologyPrecise from erasing edges when
           grid size exceeds their extent (Darafei Praliaskouski)
  - #5959, Prevent histogram target overflow when analysing massive tables (Darafei Praliaskouski)
+ - #6080, Avoid out-of-bounds hex WKB lookup for high-bit input bytes
+          (Darafei Praliaskouski)
  - #4828, geometry_columns handles NOT VALID SRID checks without errors (Darafei Praliaskouski)
  - #6048, [raster] ST_Clip no longer crashes when clipping sparse band
           selections (Darafei Praliaskouski)
diff --git a/liblwgeom/cunit/cu_in_wkb.c b/liblwgeom/cunit/cu_in_wkb.c
index 213c44a2e..c855dccf3 100644
--- a/liblwgeom/cunit/cu_in_wkb.c
+++ b/liblwgeom/cunit/cu_in_wkb.c
@@ -212,6 +212,10 @@ static void test_wkb_in_multisurface(void) {}
 
 static void test_wkb_in_malformed(void)
 {
+	char highbit_hex[3] = {(char)0xff, '0', '\0'};
+
+	cu_wkb_malformed_in(highbit_hex);
+
 	/* OSSFUXX */
 	cu_wkb_malformed_in("0000000008200000002020202020202020");
 
diff --git a/liblwgeom/lwin_wkb.c b/liblwgeom/lwin_wkb.c
index a957e16c6..762d5cd3a 100644
--- a/liblwgeom/lwin_wkb.c
+++ b/liblwgeom/lwin_wkb.c
@@ -105,8 +105,8 @@ uint8_t* bytes_from_hexbytes(const char *hexbuf, size_t hexsize)
 
 	for( i = 0; i < hexsize/2; i++ )
 	{
-		h1 = hex2char[(int)hexbuf[2*i]];
-		h2 = hex2char[(int)hexbuf[2*i+1]];
+		h1 = hex2char[(uint8_t)hexbuf[2*i]];
+		h2 = hex2char[(uint8_t)hexbuf[2*i+1]];
 		if( h1 > 15 )
 			lwerror("Invalid hex character (%c) encountered", hexbuf[2*i]);
 		if( h2 > 15 )

commit 8c5ead8c7e0c3b152929189b8f5e4f00f23525af
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Wed Jun 17 01:19:03 2026 +0400

    Avoid size_t formats in lwgeom logs
    
    Replace size_t formatting in liblwgeom logging and error messages with unsigned-long casts so MinGW builds do not warn on unsupported %zu format specifiers.
    
    Closes https://github.com/postgis/postgis/pull/903
    Closes #6003

diff --git a/NEWS b/NEWS
index 5ca8c2631..6f57e1a8c 100644
--- a/NEWS
+++ b/NEWS
@@ -60,6 +60,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
           (Darafei Praliaskouski)
  - #3179, Mark truncated libpgcommon PostgreSQL messages instead of silently
           dropping the tail (Darafei Praliaskouski)
+ - #6003, Avoid size_t formats in liblwgeom logging/error wrappers for
+          MinGW builds (Darafei Praliaskouski)
  - Build PostgreSQL extension modules with `-fno-semantic-interposition` when
           available so LTO can optimize same-DSO calls to exported PostGIS
           entry points directly instead of routing through the module PLT; in
diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c
index 99e51b0ca..bda927801 100644
--- a/liblwgeom/lwgeom_api.c
+++ b/liblwgeom/lwgeom_api.c
@@ -19,12 +19,10 @@
  **********************************************************************
  *
  * Copyright 2001-2006 Refractions Research Inc.
- * Copyright 2017 Darafei Praliaskouski <me at komzpa.net>
+ * Copyright 2017-2026 Darafei Praliaskouski <me at komzpa.net>
  *
  **********************************************************************/
 
-
-
 #include "liblwgeom_internal.h"
 #include "lwgeom_log.h"
 
@@ -452,8 +450,8 @@ void printPA(POINTARRAY *pa)
 	else mflag = "";
 
 	lwnotice("      POINTARRAY%s{", mflag);
-	lwnotice("                 ndims=%i,   ptsize=%zu",
-	         FLAGS_NDIMS(pa->flags), ptarray_point_size(pa));
+	lwnotice(
+	    "                 ndims=%i,   ptsize=%lu", FLAGS_NDIMS(pa->flags), (unsigned long)ptarray_point_size(pa));
 	lwnotice("                 npoints = %u", pa->npoints);
 
 	for (t = 0; t < pa->npoints; t++)
diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index 7631081bc..3baae4da6 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -20,10 +20,10 @@
  *
  * Copyright (C) 2012-2021 Sandro Santilli <strk at kbt.io>
  * Copyright (C) 2001-2006 Refractions Research Inc.
+ * Copyright 2026 Darafei Praliaskouski
  *
  **********************************************************************/
 
-
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -533,13 +533,11 @@ ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
 	POINT4D pbuf;
 	size_t ptsize = ptarray_point_size(pa);
 
-	LWDEBUGF(3, "pa %p p %p size %zu where %u",
-	         pa, p, pdims, where);
+	LWDEBUGF(3, "pa %p p %p size %lu where %u", pa, p, (unsigned long)pdims, where);
 
 	if ( pdims < 2 || pdims > 4 )
 	{
-		lwerror("ptarray_addPoint: point dimension out of range (%zu)",
-		        pdims);
+		lwerror("ptarray_addPoint: point dimension out of range (%lu)", (unsigned long)pdims);
 		return NULL;
 	}
 

commit ab211fe67c97b239ff2943e4ead65a71fa0fb012
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Wed Jun 17 09:57:39 2026 +0400

    libpgcommon: mark truncated PostgreSQL messages
    
    Make libpgcommon append a truncation marker when fixed-size PostgreSQL message formatting overflows, so error, warning, notice, and debug messages no longer lose their tail silently.
    
    Closes https://github.com/postgis/postgis/pull/932
    Closes #3179

diff --git a/NEWS b/NEWS
index a314e2be7..5ca8c2631 100644
--- a/NEWS
+++ b/NEWS
@@ -58,6 +58,8 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
  - GH-888, [sfcgal] Avoid stale detoasted geometry access in
           CG_Visibility empty-input handling for SFCGAL < 2.2
           (Darafei Praliaskouski)
+ - #3179, Mark truncated libpgcommon PostgreSQL messages instead of silently
+          dropping the tail (Darafei Praliaskouski)
  - Build PostgreSQL extension modules with `-fno-semantic-interposition` when
           available so LTO can optimize same-DSO calls to exported PostGIS
           entry points directly instead of routing through the module PLT; in
diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c
index fbbe5b73b..d2e2fd061 100644
--- a/libpgcommon/lwgeom_pg.c
+++ b/libpgcommon/lwgeom_pg.c
@@ -43,8 +43,10 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
+#include <string.h>
 
 #define PGC_ERRMSG_MAXLEN 2048 //256
+#define PGC_ERRMSG_TRUNCATED " [truncated]"
 
 /****************************************************************************************/
 /* Global to hold all the run-time constants */
@@ -350,6 +352,28 @@ pg_free(void *ptr)
 	pfree(ptr);
 }
 
+static void
+pg_format_message(char *errmsg, size_t errmsg_size, const char *fmt, va_list ap)
+{
+	int written = vsnprintf(errmsg, errmsg_size, fmt, ap);
+
+	if (written < 0)
+	{
+		strlcpy(errmsg, "[error formatting PostGIS message]", errmsg_size);
+		return;
+	}
+
+	if ((size_t)written >= errmsg_size)
+	{
+		const size_t suffix_size = strlen(PGC_ERRMSG_TRUNCATED);
+
+		if (errmsg_size > suffix_size)
+			memcpy(errmsg + errmsg_size - suffix_size - 1,
+			       PGC_ERRMSG_TRUNCATED,
+			       suffix_size + 1);
+	}
+}
+
 static void pg_error(const char *fmt, va_list ap) __attribute__ (( format(printf, 1, 0) ));
 
 static void
@@ -357,9 +381,7 @@ pg_error(const char *fmt, va_list ap)
 {
 	char errmsg[PGC_ERRMSG_MAXLEN+1];
 
-	vsnprintf (errmsg, PGC_ERRMSG_MAXLEN, fmt, ap);
-
-	errmsg[PGC_ERRMSG_MAXLEN]='\0';
+	pg_format_message(errmsg, sizeof(errmsg), fmt, ap);
 	ereport(ERROR, (errmsg_internal("%s", errmsg)));
 }
 
@@ -370,9 +392,7 @@ pg_warning(const char *fmt, va_list ap)
 {
 	char errmsg[PGC_ERRMSG_MAXLEN+1];
 
-	vsnprintf (errmsg, PGC_ERRMSG_MAXLEN, fmt, ap);
-
-	errmsg[PGC_ERRMSG_MAXLEN]='\0';
+	pg_format_message(errmsg, sizeof(errmsg), fmt, ap);
 	ereport(WARNING, (errmsg_internal("%s", errmsg)));
 }
 
@@ -383,9 +403,7 @@ pg_notice(const char *fmt, va_list ap)
 {
 	char errmsg[PGC_ERRMSG_MAXLEN+1];
 
-	vsnprintf (errmsg, PGC_ERRMSG_MAXLEN, fmt, ap);
-
-	errmsg[PGC_ERRMSG_MAXLEN]='\0';
+	pg_format_message(errmsg, sizeof(errmsg), fmt, ap);
 	ereport(NOTICE, (errmsg_internal("%s", errmsg)));
 }
 
@@ -395,8 +413,7 @@ static void
 pg_debug(int level, const char *fmt, va_list ap)
 {
 	char errmsg[PGC_ERRMSG_MAXLEN+1];
-	vsnprintf (errmsg, PGC_ERRMSG_MAXLEN, fmt, ap);
-	errmsg[PGC_ERRMSG_MAXLEN]='\0';
+	pg_format_message(errmsg, sizeof(errmsg), fmt, ap);
 	int pglevel[6] = {NOTICE, DEBUG1, DEBUG2, DEBUG3, DEBUG4, DEBUG5};
 
 	if ( level >= 0 && level <= 5 )

commit 0edc31efc4d80c30801755b91c82297281a35e21
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Tue Jun 16 23:37:32 2026 +0400

    sfcgal: fix regression gating and roof checks
    
    Gate polygon-repair regression tests on the CGAL version that provides the exercised behavior, keep SFCGAL 2.3-only regression selection together, and add generic roof-generation checks against the specialized wrappers.
    
    Closes https://github.com/postgis/postgis/pull/900

diff --git a/sfcgal/regress/roofgeneration.sql b/sfcgal/regress/roofgeneration.sql
index 106f5105e..50b11ab16 100644
--- a/sfcgal/regress/roofgeneration.sql
+++ b/sfcgal/regress/roofgeneration.sql
@@ -13,4 +13,10 @@ SELECT 'generic_hipped', ST_AsText(CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0
 SELECT 'generic_flat', ST_AsText(CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 'FLAT', 2.0, 30.0, 0));
 SELECT 'generic_gable_3d', ST_CoordDim(CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 'GABLE', 2.0, 30.0, 0));
 SELECT 'generic_skillion_3d', ST_CoordDim(CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 'SKILLION', 2.0, 30.0, 0));
+SELECT 'generic_gable_matches_specialized',
+  ST_AsText(CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 'GABLE', 5.0, 15.0, 0)) =
+  ST_AsText(CG_GenerateGableRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 5.0, 15.0));
+SELECT 'generic_skillion_matches_specialized',
+  ST_AsText(CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 'SKILLION', 5.0, 15.0, 0)) =
+  ST_AsText(CG_GenerateSkillionRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 5.0, 15.0, 0));
 SELECT 'invalid_type', CG_GenerateRoof('POLYGON((0 0,4 0,4 4,0 4,0 0))', 'DOME', 2.0, 30.0, 0);
diff --git a/sfcgal/regress/roofgeneration_expected b/sfcgal/regress/roofgeneration_expected
index d67b1e24d..d90fef96f 100644
--- a/sfcgal/regress/roofgeneration_expected
+++ b/sfcgal/regress/roofgeneration_expected
@@ -8,4 +8,6 @@ generic_hipped|POLYHEDRALSURFACE Z (((0 4 0,4 4 0,4 0 0,0 0 0,0 4 0)),((0 4 0,0
 generic_flat|POLYHEDRALSURFACE Z (((0 0 0,0 4 0,4 4 0,4 0 0,0 0 0)),((0 0 2,4 0 2,4 4 2,0 4 2,0 0 2)),((0 0 0,0 0 2,0 4 2,0 4 0,0 0 0)),((0 4 0,0 4 2,4 4 2,4 4 0,0 4 0)),((4 4 0,4 4 2,4 0 2,4 0 0,4 4 0)),((4 0 0,4 0 2,0 0 2,0 0 0,4 0 0)))
 generic_gable_3d|3
 generic_skillion_3d|3
+generic_gable_matches_specialized|t
+generic_skillion_matches_specialized|t
 ERROR:  CG_GenerateRoof: unknown roof type 'DOME', expected FLAT, HIPPED, GABLE or SKILLION
diff --git a/sfcgal/regress/tests.mk.in b/sfcgal/regress/tests.mk.in
index 89b2e4627..c1c39d069 100644
--- a/sfcgal/regress/tests.mk.in
+++ b/sfcgal/regress/tests.mk.in
@@ -49,13 +49,15 @@ ifeq ($(shell expr "$(POSTGIS_SFCGAL_VERSION)" ">=" 20300),1)
 	TESTS += \
 		$(top_srcdir)/sfcgal/regress/alphashape_components.sql \
 		$(top_srcdir)/sfcgal/regress/roofgeneration.sql \
-		$(top_srcdir)/sfcgal/regress/polygonrepair.sql \
 		$(top_srcdir)/sfcgal/regress/approximatemedialaxis_projected.sql \
 		$(top_srcdir)/sfcgal/regress/nurbs.sql
-	ifeq ($(shell expr "$(POSTGIS_CGAL_VERSION)" ">=" 601),1)
-		TESTS += $(top_srcdir)/sfcgal/regress/polygonrepair_union.sql
-	else
-		TESTS += $(top_srcdir)/sfcgal/regress/polygonrepair_union_pre61.sql
+	ifeq ($(shell expr "$(POSTGIS_CGAL_VERSION)" ">=" 600),1)
+		TESTS += $(top_srcdir)/sfcgal/regress/polygonrepair.sql
+		ifeq ($(shell expr "$(POSTGIS_CGAL_VERSION)" ">=" 601),1)
+			TESTS += $(top_srcdir)/sfcgal/regress/polygonrepair_union.sql
+		else
+			TESTS += $(top_srcdir)/sfcgal/regress/polygonrepair_union_pre61.sql
+		endif
 	endif
 else
 	TESTS += \

commit 5673ac9fdedc6cd309a8b3b6fca0f1a0ad5cc737
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Tue Jun 16 17:15:54 2026 +0400

    Fix SFCGAL visibility empty input handling
    
    Avoid stale detoasted geometry access in CG_Visibility empty-input compatibility handling for builds against SFCGAL before 2.2, while preserving the empty polygon result for empty inputs.
    
    Closes https://github.com/postgis/postgis/pull/888

diff --git a/NEWS b/NEWS
index 30ae0eb1a..a314e2be7 100644
--- a/NEWS
+++ b/NEWS
@@ -55,6 +55,9 @@ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed
           finite coordinates (Darafei Praliaskouski)
  - GH-892, Add OSS-Fuzz coverage for TWKB and serialized raster inputs,
           including guards for malformed TWKB reads and counts (Darafei Praliaskouski)
+ - GH-888, [sfcgal] Avoid stale detoasted geometry access in
+          CG_Visibility empty-input handling for SFCGAL < 2.2
+          (Darafei Praliaskouski)
  - Build PostgreSQL extension modules with `-fno-semantic-interposition` when
           available so LTO can optimize same-DSO calls to exported PostGIS
           entry points directly instead of routing through the module PLT; in
diff --git a/sfcgal/lwgeom_sfcgal.c b/sfcgal/lwgeom_sfcgal.c
index 000ae3211..e33c92fa3 100644
--- a/sfcgal/lwgeom_sfcgal.c
+++ b/sfcgal/lwgeom_sfcgal.c
@@ -19,6 +19,7 @@
  **********************************************************************
  *
  * Copyright 2012-2020 Oslandia <infos at oslandia.com>
+ * Copyright 2026 Darafei Praliaskouski <me at komzpa.net>
  *
  **********************************************************************/
 
@@ -1235,22 +1236,30 @@ sfcgal_visibility_point(PG_FUNCTION_ARGS)
 	input0 = PG_GETARG_GSERIALIZED_P(0);
 	srid = gserialized_get_srid(input0);
 	input1 = PG_GETARG_GSERIALIZED_P(1);
-	polygon = POSTGIS2SFCGALGeometry(input0);
-	PG_FREE_IF_COPY(input0, 0);
-	point = POSTGIS2SFCGALGeometry(input1);
-	PG_FREE_IF_COPY(input1, 1);
 
 #if POSTGIS_SFCGAL_VERSION < 20200
+	/*
+	 * SFCGAL < 2.2 needs PostGIS to preserve the empty-input result.
+	 * Check this before converting and freeing detoasted inputs, because
+	 * gserialized_is_empty() must not inspect a freed copy.
+	 */
 	if (gserialized_is_empty(input0) || gserialized_is_empty(input1))
 	{
 		result = sfcgal_polygon_create();
 		output = SFCGALGeometry2POSTGIS(result, 0, srid);
 		sfcgal_geometry_delete(result);
 
+		PG_FREE_IF_COPY(input0, 0);
+		PG_FREE_IF_COPY(input1, 1);
 		PG_RETURN_POINTER(output);
 	}
 #endif
 
+	polygon = POSTGIS2SFCGALGeometry(input0);
+	PG_FREE_IF_COPY(input0, 0);
+	point = POSTGIS2SFCGALGeometry(input1);
+	PG_FREE_IF_COPY(input1, 1);
+
 	result = sfcgal_geometry_visibility_point(polygon, point);
 	sfcgal_geometry_delete(polygon);
 	sfcgal_geometry_delete(point);
@@ -1285,24 +1294,33 @@ sfcgal_visibility_segment(PG_FUNCTION_ARGS)
 	srid = gserialized_get_srid(input0);
 	input1 = PG_GETARG_GSERIALIZED_P(1);
 	input2 = PG_GETARG_GSERIALIZED_P(2);
-	polygon = POSTGIS2SFCGALGeometry(input0);
-	PG_FREE_IF_COPY(input0, 0);
-	pointA = POSTGIS2SFCGALGeometry(input1);
-	PG_FREE_IF_COPY(input1, 1);
-	pointB = POSTGIS2SFCGALGeometry(input2);
-	PG_FREE_IF_COPY(input2, 2);
 
 #if POSTGIS_SFCGAL_VERSION < 20200
+	/*
+	 * SFCGAL < 2.2 needs PostGIS to preserve the empty-input result.
+	 * Check this before converting and freeing detoasted inputs, because
+	 * gserialized_is_empty() must not inspect a freed copy.
+	 */
 	if (gserialized_is_empty(input0) || gserialized_is_empty(input1) || gserialized_is_empty(input2))
 	{
 		result = sfcgal_polygon_create();
 		output = SFCGALGeometry2POSTGIS(result, 0, srid);
 		sfcgal_geometry_delete(result);
 
+		PG_FREE_IF_COPY(input0, 0);
+		PG_FREE_IF_COPY(input1, 1);
+		PG_FREE_IF_COPY(input2, 2);
 		PG_RETURN_POINTER(output);
 	}
 #endif
 
+	polygon = POSTGIS2SFCGALGeometry(input0);
+	PG_FREE_IF_COPY(input0, 0);
+	pointA = POSTGIS2SFCGALGeometry(input1);
+	PG_FREE_IF_COPY(input1, 1);
+	pointB = POSTGIS2SFCGALGeometry(input2);
+	PG_FREE_IF_COPY(input2, 2);
+
 	result = sfcgal_geometry_visibility_segment(polygon, pointA, pointB);
 	sfcgal_geometry_delete(polygon);
 	sfcgal_geometry_delete(pointA);

commit f1330c340b2d84e93738ea042ee582b003e4d028
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Thu Jun 18 11:23:12 2026 +0400

    Stabilize NURBS approximation regression output
    
    Apply explicit two-decimal ST_AsText output for the high-tolerance NURBS approximation regression so SFCGAL/CGAL precision drift does not fail otherwise unrelated CI runs.
    
    Closes https://github.com/postgis/postgis/pull/959

diff --git a/sfcgal/regress/nurbs.sql b/sfcgal/regress/nurbs.sql
index a71fc9f54..bed1a0361 100644
--- a/sfcgal/regress/nurbs.sql
+++ b/sfcgal/regress/nurbs.sql
@@ -96,7 +96,7 @@ SELECT 'approximate_high_tol', ST_AsText(CG_NurbsCurveApproximate(
     'LINESTRING(0 0, 1 2.1, 2 1.9, 3 3.2, 4 2.8, 5 1)'::geometry,
     2,
     0.5
-));
+), 2);
 
 -- Test approximation with 3D points
 SELECT 'approximate_3d', ST_AsText(CG_NurbsCurveApproximate(
diff --git a/sfcgal/regress/nurbs_expected b/sfcgal/regress/nurbs_expected
index a7e2856fb..9ccee264f 100644
--- a/sfcgal/regress/nurbs_expected
+++ b/sfcgal/regress/nurbs_expected
@@ -10,6 +10,6 @@ ERROR:  Data points must be a LINESTRING
 ERROR:  Need at least 4 data points for degree 3 interpolation
 approximate_default|NURBSCURVE(DEGREE 3,CONTROLPOINTS(NURBSPOINT(WEIGHTEDPOINT(0 0),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(0.18 -0.15),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(1.49 4.36),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(3.33 1.33),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(4.34 0.83),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(5 0),WEIGHT 1)),KNOTS (KNOT(0,4),KNOT(0.46,1),KNOT(0.64,1),KNOT(1,4)))
 approximate_max_ctrl|NURBSCURVE(DEGREE 3,CONTROLPOINTS(NURBSPOINT(WEIGHTEDPOINT(0 0),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(3.3 6.18),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(6.48 40.13),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(8.84 73.32),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(10 100),WEIGHT 1)),KNOTS (KNOT(0,4),KNOT(0.21,1),KNOT(1,4)))
-approximate_high_tol|NURBSCURVE(DEGREE 2,CONTROLPOINTS(NURBSPOINT(WEIGHTEDPOINT(0 0),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(-0.048424154393691 2.640915492953116),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(2.237552942255657 1.646186724700419),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(2.786598026195684 3.476253776863865),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(4.840573182610214 2.429625830321494),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(5 1),WEIGHT 1)),KNOTS (KNOT(0,3),KNOT(0.349154606588781,1),KNOT(0.512902297757245,1),KNOT(0.680173066921787,1),KNOT(1,3)))
+approximate_high_tol|NURBSCURVE(DEGREE 2,CONTROLPOINTS(NURBSPOINT(WEIGHTEDPOINT(0 0),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(-0.05 2.64),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(2.24 1.65),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(2.79 3.48),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(4.84 2.43),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT(5 1),WEIGHT 1)),KNOTS (KNOT(0,3),KNOT(0.35,1),KNOT(0.51,1),KNOT(0.68,1),KNOT(1,3)))
 approximate_3d|NURBSCURVE Z (DEGREE 3,CONTROLPOINTS Z (NURBSPOINT(WEIGHTEDPOINT Z (0 0 0),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT Z (0.18 -0.15 -1.29),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT Z (1.49 4.36 3.35),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT Z (3.33 1.33 0.38),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT Z (4.34 0.83 -0.44),WEIGHT 1),NURBSPOINT(WEIGHTEDPOINT Z (5 0 0),WEIGHT 1)),KNOTS (KNOT(0,4),KNOT(0.46,1),KNOT(0.64,1),KNOT(1,4)))
 ERROR:  Need at least 4 data points for degree 3 approximation

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

Summary of changes:
 NEWS                        | 2 ++
 liblwgeom/cunit/cu_in_wkb.c | 4 ++++
 liblwgeom/lwin_wkb.c        | 4 ++--
 3 files changed, 8 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list