From trac at osgeo.org Wed Apr 1 00:46:08 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 01 Apr 2026 07:46:08 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.1f26da520a373f6044b888a41595e965@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): I have installed this version on a new server and am currently running it on other problem areas where we miss results. When running CreateTopology with zero precision, I encountered the following error: {{{ XX000: Side-location conflict: new edge starts in face 63 and ends in face 6876 }}} However, when I switch back to a precision of 1e?07, it works correctly for that area. At the moment, the main focus is to get the correct results. I will do more comparative testing of these two versions later and report back. Regarding the comment about running with zero tolerance: one drawback is that it leaves a big cleanup work for the post jobs. This typically involves removing a significant number of extra edges, which is time?consuming. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 1 08:11:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 1 Apr 2026 08:11:51 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-423-g53280a4f6 Message-ID: <20260401151151.46954361C8@trac.osgeo.org> 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 53280a4f683f696e8086609fd681d380519487b9 (commit) from eafd5af097db3b2b0541342923431dbcd214c386 (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 53280a4f683f696e8086609fd681d380519487b9 Author: Paul Ramsey Date: Wed Apr 1 08:11:42 2026 -0700 See also updates diff --git a/doc/reference_overlay.xml b/doc/reference_overlay.xml index 7225cea18..16ffc5f90 100644 --- a/doc/reference_overlay.xml +++ b/doc/reference_overlay.xml @@ -1133,13 +1133,14 @@ MULTILINESTRING((3 4,4 5),(1 2,3 4)) See Also - , + , , , + , , , , - + ----------------------------------------------------------------------- Summary of changes: doc/reference_overlay.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Wed Apr 1 12:04:56 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 1 Apr 2026 12:04:56 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-426-gae9559672 Message-ID: <20260401190456.C66E034941@trac.osgeo.org> 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 ae9559672d2e329cee44bd697bac8411b94af13f (commit) via 765787f0976adfe7ae83cbf4dabf7cb5188288b9 (commit) via 515152e7bf193e6d75831e3794d9d0610d9c7dae (commit) from 53280a4f683f696e8086609fd681d380519487b9 (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 ae9559672d2e329cee44bd697bac8411b94af13f Author: Paul Ramsey Date: Wed Apr 1 12:04:51 2026 -0700 Add news entry for ST_CoverageEdges diff --git a/NEWS b/NEWS index be561f67a..a0a1146c4 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,8 @@ This version requires GEOS 3.10 or higher * New Features * + - ST_CoverageEdges, returns MultiLinestring of distinct shared edges in + polygonal coverage (Paul Ramsey) - ST_MinimumSpanningTree, window function to calculate MST (Paul Ramsey) - #5993, [topology] Add max_edges parameter to TopoGeo_AddLinestring (Sandro Santilli) commit 765787f0976adfe7ae83cbf4dabf7cb5188288b9 Author: Paul Ramsey Date: Wed Apr 1 12:03:17 2026 -0700 Implement ST_CoverageEdges using GEOSCoverageEdges from GEOS 3.15 diff --git a/doc/reference_coverage.xml b/doc/reference_coverage.xml index ccd8b868a..bad27160a 100644 --- a/doc/reference_coverage.xml +++ b/doc/reference_coverage.xml @@ -357,6 +357,76 @@ SELECT id, ST_AsText(ST_CoverageSimplify(geom, 30) OVER ()) + + + ST_CoverageEdges + + Computes the unique edges of a polygonal coverage. + + + + + + geometry ST_CoverageEdges + geometry + geom + integer + edgetype = 0 + + + geometry ST_CoverageEdges + geometry[] + geoms + integer + edgetype = 0 + + + + + + Description + + Returns a MultiLineString representing the unique edges of a polygonal coverage. + A polygonal coverage is a set of non-overlapping polygons where adjacent polygons have matching vertices along shared edges. + + The edgetype parameter can be used to select which edges are returned: + + 0 (ALL) - all unique edges (default) + 1 (EXTERIOR) - only exterior edges (non-shared) + 2 (INTERIOR) - only interior edges (shared) + + + + Availability: 3.7.0 + Requires GEOS >= 3.15.0 + + + + Examples + +-- Get all unique edges of a coverage +SELECT ST_AsText(ST_CoverageEdges(ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)), POLYGON((10 0, 20 0, 20 10, 10 10, 10 0)))'))); +-------------------------------------- +MULTILINESTRING((0 0, 10 0), (10 0, 20 0), (20 0, 20 10), (20 10, 10 10), (10 10, 0 10), (0 10, 0 0), (10 0, 10 10)) + +-- Get only interior (shared) edges +SELECT ST_AsText(ST_CoverageEdges(ST_GeomFromText('GEOMETRYCOLLECTION(POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)), POLYGON((10 0, 20 0, 20 10, 10 10, 10 0)))'), 2)); +-------------------------------------- +MULTILINESTRING((10 0, 10 10)) + + + + + See Also + + , + , + + + + + + ST_CoverageUnion diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index 2870527fe..be55bdaba 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -982,6 +982,7 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) GEOSGeometry *geos = NULL; GEOSGeometry *geos_result = NULL; uint32 ngeoms = 0; + int srid = SRID_UNKNOWN; ArrayType *array = PG_GETARG_ARRAYTYPE_P(0); uint32 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)); @@ -1006,6 +1007,10 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) gser = (GSERIALIZED *)DatumGetPointer(value); if (gserialized_is_empty(gser)) continue; + /* Get SRID from first non-null element */ + if (srid == SRID_UNKNOWN) + srid = gserialized_get_srid(gser); + /* Omit unconvertible */ geos = POSTGIS2GEOS(gser); if (!geos) continue; @@ -1015,7 +1020,9 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) array_free_iterator(iterator); if (ngeoms == 0) + { PG_RETURN_NULL(); + } geos = GEOSGeom_createCollection( GEOS_GEOMETRYCOLLECTION, @@ -1027,6 +1034,8 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) HANDLE_GEOS_ERROR("Geometry could not be converted"); } + GEOSSetSRID(geos, srid); + geos_result = GEOSCoverageUnion(geos); GEOSGeom_destroy(geos); if (!geos_result) @@ -1038,6 +1047,139 @@ Datum ST_CoverageUnion(PG_FUNCTION_ARGS) PG_RETURN_POINTER(result); } + +/********************************************************************** + * ST_CoverageEdges(geometry, edgetype) + * ST_CoverageEdges(geometry[], edgetype) + * + */ + +Datum ST_CoverageEdges(PG_FUNCTION_ARGS); +PG_FUNCTION_INFO_V1(ST_CoverageEdges); +Datum ST_CoverageEdges(PG_FUNCTION_ARGS) +{ +#if POSTGIS_GEOS_VERSION < 31500 + lwpgerror("The GEOS version this PostGIS binary " + "was compiled against (%d) doesn't support " + "'ST_CoverageEdges' function (3.15.0+ required)", + POSTGIS_GEOS_VERSION); + PG_RETURN_NULL(); +#else + GSERIALIZED *result = NULL; + GSERIALIZED *gser = PG_GETARG_GSERIALIZED_P(0); + int edgetype = PG_GETARG_INT32(1); + GEOSGeometry *geos = NULL; + GEOSGeometry *geos_result = NULL; + + if (gserialized_is_empty(gser)) + PG_RETURN_NULL(); + + initGEOS(lwpgnotice, lwgeom_geos_error); + + geos = POSTGIS2GEOS(gser); + if (!geos) + HANDLE_GEOS_ERROR("Geometry could not be converted"); + + geos_result = GEOSCoverageEdges(geos, edgetype); + GEOSGeom_destroy(geos); + if (!geos_result) + HANDLE_GEOS_ERROR("Error computing coverage edges"); + + result = GEOS2POSTGIS(geos_result, LW_FALSE); + GEOSGeom_destroy(geos_result); + + PG_RETURN_POINTER(result); +#endif +} + +Datum ST_CoverageEdges_array(PG_FUNCTION_ARGS); +PG_FUNCTION_INFO_V1(ST_CoverageEdges_array); +Datum ST_CoverageEdges_array(PG_FUNCTION_ARGS) +{ +#if POSTGIS_GEOS_VERSION < 31500 + lwpgerror("The GEOS version this PostGIS binary " + "was compiled against (%d) doesn't support " + "'ST_CoverageEdges' function (3.15.0+ required)", + POSTGIS_GEOS_VERSION); + PG_RETURN_NULL(); +#else + GSERIALIZED *result = NULL; + int edgetype = PG_GETARG_INT32(1); + + Datum value; + bool isnull; + + GEOSGeometry **geoms = NULL; + GEOSGeometry *geos = NULL; + GEOSGeometry *geos_result = NULL; + uint32 ngeoms = 0; + int srid = SRID_UNKNOWN; + + ArrayType *array = PG_GETARG_ARRAYTYPE_P(0); + uint32 nelems = ArrayGetNItems(ARR_NDIM(array), ARR_DIMS(array)); + ArrayIterator iterator = array_create_iterator(array, 0, NULL); + + /* Return null on 0-elements input array */ + if (nelems == 0) + PG_RETURN_NULL(); + + /* Convert all geometries into GEOSGeometry array */ + geoms = palloc(sizeof(GEOSGeometry *) * nelems); + + initGEOS(lwpgnotice, lwgeom_geos_error); + + while (array_iterate(iterator, &value, &isnull)) + { + GSERIALIZED *gser; + /* Omit nulls */ + if (isnull) continue; + + /* Omit empty */ + gser = (GSERIALIZED *)DatumGetPointer(value); + if (gserialized_is_empty(gser)) continue; + + /* Get SRID from first non-null element */ + if (srid == SRID_UNKNOWN) + srid = gserialized_get_srid(gser); + + /* Omit unconvertible */ + geos = POSTGIS2GEOS(gser); + if (!geos) continue; + + geoms[ngeoms++] = geos; + } + array_free_iterator(iterator); + + if (ngeoms == 0) + { + PG_RETURN_NULL(); + } + + geos = GEOSGeom_createCollection( + GEOS_GEOMETRYCOLLECTION, + geoms, ngeoms); + + if (!geos) + { + coverage_destroy_geoms(geoms, ngeoms); + HANDLE_GEOS_ERROR("Geometry could not be converted"); + } + + GEOSSetSRID(geos, srid); + + geos_result = GEOSCoverageEdges(geos, edgetype); + GEOSGeom_destroy(geos); + if (!geos_result) + HANDLE_GEOS_ERROR("Error computing coverage edges"); + + result = GEOS2POSTGIS(geos_result, LW_FALSE); + GEOSGeom_destroy(geos_result); + + PG_RETURN_POINTER(result); +#endif +} + + extern Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(ST_MinimumSpanningTree); Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS) diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in index 41a7ee22a..649ed3fc5 100644 --- a/postgis/postgis.sql.in +++ b/postgis/postgis.sql.in @@ -4498,6 +4498,20 @@ CREATE OR REPLACE FUNCTION ST_CoverageClean (geom geometry, gapMaximumWidth floa LANGUAGE 'c' IMMUTABLE STRICT WINDOW PARALLEL SAFE _COST_HIGH; +-- Availability: 3.7.0 +CREATE OR REPLACE FUNCTION ST_CoverageEdges (geoms geometry[], edgetype integer default 0) + RETURNS geometry + AS 'MODULE_PATHNAME', 'ST_CoverageEdges_array' + LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE + _COST_HIGH; + +-- Availability: 3.7.0 +CREATE OR REPLACE FUNCTION ST_CoverageEdges (geom geometry, edgetype integer default 0) + RETURNS geometry + AS 'MODULE_PATHNAME', 'ST_CoverageEdges' + LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE + _COST_HIGH; + -------------------------------------------------------------------------------- -- Availability: 2.3.0 diff --git a/regress/core/coverage.sql b/regress/core/coverage.sql index 9c456410c..159022e83 100644 --- a/regress/core/coverage.sql +++ b/regress/core/coverage.sql @@ -101,3 +101,29 @@ FROM squares GROUP BY i, j ORDER By i, j; +------------------------------------------------------------------------ + +CREATE TABLE coverage_edges (id integer, seq integer, geom geometry); + +INSERT INTO coverage_edges VALUES +(6, 1, 'POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'), +(6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); + +SELECT 'coverage edges all' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom))) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges exterior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges interior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges array' AS test, + ST_AsText(ST_CoverageEdges(array_agg(geom))) +FROM coverage_edges WHERE id = 6; + +DROP TABLE coverage_edges; + diff --git a/regress/core/coverage_expected b/regress/core/coverage_expected index 2b456107a..2a0304871 100644 --- a/regress/core/coverage_expected +++ b/regress/core/coverage_expected @@ -36,3 +36,7 @@ grid squares|1|2|50000 grid squares|2|0|50000 grid squares|2|1|50000 grid squares|2|2|10000 +coverage edges all|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges exterior|MULTILINESTRING((10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges interior|MULTILINESTRING((10 10,10 0)) +coverage edges array|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) commit 515152e7bf193e6d75831e3794d9d0610d9c7dae Author: Paul Ramsey Date: Wed Apr 1 10:33:30 2026 -0700 Simplify stringbuffer handling a little diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c index 8db842117..9065bdf6f 100644 --- a/loader/shp2pgsql-core.c +++ b/loader/shp2pgsql-core.c @@ -1479,8 +1479,7 @@ ShpLoaderGetSQLHeader(SHPLOADERSTATE *state, char **strheader) } /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strheader = ret; @@ -1519,8 +1518,7 @@ ShpLoaderGetSQLCopyStatement(SHPLOADERSTATE *state, char **strheader) } /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strheader = ret; @@ -1851,14 +1849,13 @@ done_cell: /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strrecord = ret; /* If any warnings occurred, set the returned message string and warning status */ - if (strlen((char *)stringbuffer_getstring(sbwarn)) > 0) + if (stringbuffer_getlength(sbwarn) > 0) { snprintf(state->message, SHPLOADERMSGLEN, "%s", stringbuffer_getstring(sbwarn)); stringbuffer_destroy(sbwarn); @@ -1943,8 +1940,7 @@ ShpLoaderGetSQLFooter(SHPLOADERSTATE *state, char **strfooter) } /* Copy the string buffer into a new string, destroying the string buffer */ - ret = (char *)malloc(strlen((char *)stringbuffer_getstring(sb)) + 1); - strcpy(ret, (char *)stringbuffer_getstring(sb)); + ret = strdup(stringbuffer_getstring(sb)); stringbuffer_destroy(sb); *strfooter = ret; ----------------------------------------------------------------------- Summary of changes: NEWS | 2 + doc/reference_coverage.xml | 70 ++++++++++++++++++++ loader/shp2pgsql-core.c | 14 ++-- postgis/lwgeom_window.c | 142 +++++++++++++++++++++++++++++++++++++++++ postgis/postgis.sql.in | 14 ++++ regress/core/coverage.sql | 26 ++++++++ regress/core/coverage_expected | 4 ++ 7 files changed, 263 insertions(+), 9 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 1 12:05:51 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 01 Apr 2026 19:05:51 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.1663215e9cb801d76134db726d748e9b@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Replying to [comment:7 maxsynytsky1v]: > sql.xz originally and retried today with just txt but it is still undeliverable and the error is the same. Try emailing to me lr at pcorp dot us. If that doesn't work, I'll give you a nextcloud private link to upload it to. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 1 13:13:35 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 1 Apr 2026 13:13:35 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-428-ga5ceec2d8 Message-ID: <20260401201335.CA2D5110209@trac.osgeo.org> 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 a5ceec2d826c271bab53fc5614dc26c4d174bc9b (commit) via 953790c4b42241b7a37f36e846a1896a01a0ca15 (commit) from ae9559672d2e329cee44bd697bac8411b94af13f (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 a5ceec2d826c271bab53fc5614dc26c4d174bc9b Author: Paul Ramsey Date: Wed Apr 1 13:07:12 2026 -0700 Ensure ST_CoverageEdges tests are deterministic with ORDER BY diff --git a/regress/core/geos315.sql b/regress/core/geos315.sql index 4c30bfbfe..b30f0657a 100644 --- a/regress/core/geos315.sql +++ b/regress/core/geos315.sql @@ -51,19 +51,19 @@ INSERT INTO coverage_edges VALUES (6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); SELECT 'coverage edges all' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom))) + ST_AsText(ST_CoverageEdges(ST_Collect(geom ORDER BY seq))) FROM coverage_edges WHERE id = 6; SELECT 'coverage edges exterior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) + ST_AsText(ST_CoverageEdges(ST_Collect(geom ORDER BY seq), 1)) FROM coverage_edges WHERE id = 6; SELECT 'coverage edges interior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) + ST_AsText(ST_CoverageEdges(ST_Collect(geom ORDER BY seq), 2)) FROM coverage_edges WHERE id = 6; SELECT 'coverage edges array' AS test, - ST_AsText(ST_CoverageEdges(array_agg(geom))) + ST_AsText(ST_CoverageEdges(array_agg(geom ORDER BY seq))) FROM coverage_edges WHERE id = 6; DROP TABLE coverage_edges; commit 953790c4b42241b7a37f36e846a1896a01a0ca15 Author: Paul Ramsey Date: Wed Apr 1 13:01:45 2026 -0700 Move ST_CoverageEdges and ST_MinimumSpanningTree tests to version-gated geos315 test file diff --git a/regress/core/coverage.sql b/regress/core/coverage.sql index 159022e83..9c456410c 100644 --- a/regress/core/coverage.sql +++ b/regress/core/coverage.sql @@ -101,29 +101,3 @@ FROM squares GROUP BY i, j ORDER By i, j; ------------------------------------------------------------------------- - -CREATE TABLE coverage_edges (id integer, seq integer, geom geometry); - -INSERT INTO coverage_edges VALUES -(6, 1, 'POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'), -(6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); - -SELECT 'coverage edges all' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom))) -FROM coverage_edges WHERE id = 6; - -SELECT 'coverage edges exterior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) -FROM coverage_edges WHERE id = 6; - -SELECT 'coverage edges interior' AS test, - ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) -FROM coverage_edges WHERE id = 6; - -SELECT 'coverage edges array' AS test, - ST_AsText(ST_CoverageEdges(array_agg(geom))) -FROM coverage_edges WHERE id = 6; - -DROP TABLE coverage_edges; - diff --git a/regress/core/coverage_expected b/regress/core/coverage_expected index 2a0304871..2b456107a 100644 --- a/regress/core/coverage_expected +++ b/regress/core/coverage_expected @@ -36,7 +36,3 @@ grid squares|1|2|50000 grid squares|2|0|50000 grid squares|2|1|50000 grid squares|2|2|10000 -coverage edges all|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) -coverage edges exterior|MULTILINESTRING((10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) -coverage edges interior|MULTILINESTRING((10 10,10 0)) -coverage edges array|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) diff --git a/regress/core/spanningtree.sql b/regress/core/geos315.sql similarity index 66% rename from regress/core/spanningtree.sql rename to regress/core/geos315.sql index 063c18855..4c30bfbfe 100644 --- a/regress/core/spanningtree.sql +++ b/regress/core/geos315.sql @@ -1,4 +1,6 @@ +-- ST_MinimumSpanningTree + -- Connected graph (all one cluster) SELECT 'connected', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id) FROM (VALUES (1, 'LINESTRING(0 0,1 0)'::geometry), @@ -40,3 +42,28 @@ SELECT 'empty', id, ST_MinimumSpanningTree(geom) OVER (ORDER BY id), ST_AsText(g (6, 'LINESTRING(1 0,0 1)'::geometry) ) AS t(id, geom); +-- ST_CoverageEdges + +CREATE TABLE coverage_edges (id integer, seq integer, geom geometry); + +INSERT INTO coverage_edges VALUES +(6, 1, 'POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))'), +(6, 2, 'POLYGON ((10 0, 10 10, 20 10, 20 0, 10 0))'); + +SELECT 'coverage edges all' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom))) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges exterior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 1)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges interior' AS test, + ST_AsText(ST_CoverageEdges(ST_Collect(geom), 2)) +FROM coverage_edges WHERE id = 6; + +SELECT 'coverage edges array' AS test, + ST_AsText(ST_CoverageEdges(array_agg(geom))) +FROM coverage_edges WHERE id = 6; + +DROP TABLE coverage_edges; diff --git a/regress/core/spanningtree_expected b/regress/core/geos315_expected similarity index 60% rename from regress/core/spanningtree_expected rename to regress/core/geos315_expected index 8421fd061..9eae3c024 100644 --- a/regress/core/spanningtree_expected +++ b/regress/core/geos315_expected @@ -22,3 +22,7 @@ empty|3|0|LINESTRING EMPTY empty|4|1|LINESTRING(1 1,1 0) empty|5|0|LINESTRING(0 0,1 1) empty|6|1|LINESTRING(1 0,0 1) +coverage edges all|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges exterior|MULTILINESTRING((10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) +coverage edges interior|MULTILINESTRING((10 10,10 0)) +coverage edges array|MULTILINESTRING((10 10,10 0),(10 0,0 0,0 10,10 10),(10 10,20 10,20 0,10 0)) diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in index d34642e3d..fc998a755 100644 --- a/regress/core/tests.mk.in +++ b/regress/core/tests.mk.in @@ -168,7 +168,7 @@ endif ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31500),1) TESTS += \ - $(top_srcdir)/regress/core/spanningtree + $(top_srcdir)/regress/core/geos315 endif ifeq ($(shell expr "$(POSTGIS_GEOS_VERSION)" ">=" 31200),1) ----------------------------------------------------------------------- Summary of changes: regress/core/coverage.sql | 26 --------------------- regress/core/coverage_expected | 4 ---- regress/core/{spanningtree.sql => geos315.sql} | 27 ++++++++++++++++++++++ .../{spanningtree_expected => geos315_expected} | 4 ++++ regress/core/tests.mk.in | 2 +- 5 files changed, 32 insertions(+), 31 deletions(-) rename regress/core/{spanningtree.sql => geos315.sql} (65%) rename regress/core/{spanningtree_expected => geos315_expected} (60%) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 1 16:56:07 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 01 Apr 2026 23:56:07 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.465e7480ed6577c0ee8e7b67fc16789a@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Still undeliverable. Also tried without extension at all just in case but still no luck. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 2 11:01:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 2 Apr 2026 11:01:51 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-429-g245ee074f Message-ID: <20260402180151.630A4117FB1@trac.osgeo.org> 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 245ee074f2ca166f296a04ded14ad83c94978c32 (commit) from a5ceec2d826c271bab53fc5614dc26c4d174bc9b (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 245ee074f2ca166f296a04ded14ad83c94978c32 Author: Paul Ramsey Date: Thu Apr 2 10:28:46 2026 -0700 Quiet CI warnings calling into GEOS CAPI function diff --git a/postgis/lwgeom_window.c b/postgis/lwgeom_window.c index be55bdaba..9b0e6e976 100644 --- a/postgis/lwgeom_window.c +++ b/postgis/lwgeom_window.c @@ -1227,7 +1227,7 @@ Datum ST_MinimumSpanningTree(PG_FUNCTION_ARGS) /* Note: GEOSMinimumSpanningTree signature assumed: size_t* GEOSMinimumSpanningTree(GEOSGeometry* const* geoms, size_t ngeoms); */ - cluster_ids = GEOSMinimumSpanningTree(geoms, ngeoms); + cluster_ids = GEOSMinimumSpanningTree((const GEOSGeometry * const *)geoms, ngeoms); if (cluster_ids) { ----------------------------------------------------------------------- Summary of changes: postgis/lwgeom_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 2 11:46:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 18:46:21 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.d9ff52d41b20be26abf2acadd925625d@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Replying to [comment:9 maxsynytsky1v]: > Still undeliverable. Also tried without extension at all just in case but still no luck. Here is a nextcloud drop link: https://nextcloud.osgeo.org/s/dgBPQrfJE6H3yWS Will let you only upload a file and only I can read it. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 2 12:04:45 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 19:04:45 -0000 Subject: [PostGIS] #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix In-Reply-To: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> References: <049.53e6f5bd167d0c7df5c745e96eec6194@osgeo.org> Message-ID: <064.7acd09f956ab320270c92d5ba8ab00a3@osgeo.org> #6059: AddGeometryColumn calls postgis_type_name without @extschema@ prefix ----------------------+--------------------- Reporter: fthomas | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------+--------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 2 12:21:04 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 19:21:04 -0000 Subject: [PostGIS] #6038: Using public.geometry_columns causes 'could not open relation with OID 188954716' after drop geometry tables In-Reply-To: <050.410b70db9c436ac53a1e23f89f1c69ff@osgeo.org> References: <050.410b70db9c436ac53a1e23f89f1c69ff@osgeo.org> Message-ID: <065.9590a4600c9965774566a4376fab42c2@osgeo.org> #6038: Using public.geometry_columns causes 'could not open relation with OID 188954716' after drop geometry tables --------------------------------+-------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: blocker | Milestone: Component: topology | Version: master Resolution: | Keywords: --------------------------------+-------------------- Changes (by pramsey): * component: postgis => topology * owner: pramsey => strk -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 2 12:27:57 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 2 Apr 2026 12:27:57 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-430-g8cfe6fe6d Message-ID: <20260402192757.9D6541166C2@trac.osgeo.org> 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 8cfe6fe6de8906da79047f15d4a340a775aa1f51 (commit) from 245ee074f2ca166f296a04ded14ad83c94978c32 (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 8cfe6fe6de8906da79047f15d4a340a775aa1f51 Author: Paul Ramsey Date: Thu Apr 2 12:27:50 2026 -0700 Clarification per #6037 diff --git a/doc/xsl-config.xml b/doc/xsl-config.xml index 77437e98e..fb7904494 100644 --- a/doc/xsl-config.xml +++ b/doc/xsl-config.xml @@ -161,9 +161,9 @@ If the optional gridSize parameter is given (GEOS-3.9.0 or higher required), - all result vertices are guaranteed to fall on a grid of the specified - size. For the operation to give predictable results all the input vertices - must fall already on the specified grid, see . + all result vertices are guaranteed to fall on a snap-rounded grid of the specified + size. Note that operations performed on a grid may contain small artifacts + produced during grid alignment, see . ----------------------------------------------------------------------- Summary of changes: doc/xsl-config.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 2 12:28:12 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 19:28:12 -0000 Subject: [PostGIS] #6037: st_union with gridSize produces unexpected result In-Reply-To: <055.66fcb2bb2dfa7293cd8f6b12b8a210f3@osgeo.org> References: <055.66fcb2bb2dfa7293cd8f6b12b8a210f3@osgeo.org> Message-ID: <070.09a3efbd7e81626e9ef1588a06c8eb12@osgeo.org> #6037: st_union with gridSize produces unexpected result ------------------------------------+--------------------- Reporter: Asger Skovbo Petersen | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ------------------------------------+--------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed Comment: Changed at 8cfe6fe6d -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 2 13:13:15 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 20:13:15 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.ffa7948c970b353df33273ed8810f965@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): Hm, I just built out 3.4 and 3.5 against pg18 and I get the errors on *both* versions. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 2 13:25:23 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 20:25:23 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.22fafdad05aaf31550530d55f7961abe@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): Shorter reproducer, just one row. {{{ CREATE TABLE reproduce AS SELECT 1 AS id, ST_GeomFromText('POLYGON ((133917.695 490000, 133708.3 491825.92, 133541.312 491951.805, 133460 491840, 132820 491000, 132210 490190, 132460 490000, 132700 490000, 133894.531 490000, 133917.695 490000))', 28992)::GEOMETRY(POLYGON, 28992) AS geometry; CREATE INDEX idx_reproduce_geometry ON reproduce USING GIST(geometry); SET enable_seqscan = OFF; SELECT id, geometry <-> ST_SetSRID(ST_MakePoint(133718, 489222), 28992) AS opdist, ST_Distance(geometry, ST_SetSRID(ST_MakePoint(133718, 489222), 28992)) AS funcdist FROM reproduce; SELECT id FROM reproduce ORDER BY geometry <-> ST_SetSRID(ST_MakePoint(133718, 489222), 28992); }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 2 15:50:35 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 02 Apr 2026 22:50:35 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.aff4b3cf1cb383788393e96317829f96@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): And building 3.4 and 3.5 against _pg16_ I still get errors on _both_ versions. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 3 22:53:32 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 04 Apr 2026 05:53:32 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.f4ccffb49794996e0fc99904beafd3aa@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by Lars Aksel Opsahl): * Attachment "error_test_38_1_4.sql" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 3 23:03:18 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 04 Apr 2026 06:03:18 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.256aa01a738f48c731baae55beb8b0ba@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): Running branch t6062-fix with POSTGIS="3.7.0dev 3.6.0rc2-418-g790ef7815", I now get the following error when running this file: {{{ LOCATION: exec_stmt_raise, pl_exec.c:3910 error | id1 | id2 -----------------------------+-----+-------- mixed face labeling in ring | -19 | [NULL] (1 row) }}} When running the older branch 3.7.0dev 3.6.0rc2-305-g3b3488ddf, I do not get any errors. Running with a tolerance of 1e-07 on t6062-fix also seems to avoid the error, but that may causes problems elsewhere. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 6 14:58:29 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 06 Apr 2026 21:58:29 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.3884daead6d1a69dc2117908689481be@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by pramsey): So, doing a little digging into the debugger, I find that: * The index distance between the bounds of the polygon and the point is exactly 778. * Meanwhile, the "exact" distance between the polygon and the point is... less. {{{ SELECT ST_Distance( 'LINESTRING(132700 490000, 133894.531 490000)', 'POINT(133718 489222)' ); st_distance ------------------- 777.9999999999999 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 6 14:59:17 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 06 Apr 2026 21:59:17 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.5fd194afb4cf61150269b969d8e55a65@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Changes (by pramsey): * Attachment "Screenshot 2026-04-06 at 2.58.52?PM.png" added. Test Point and Polygon that are exhibiting the behaviour -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 00:24:51 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:24:51 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring Message-ID: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring ----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Keywords: | ----------------------+-------------------- As of commit [67ff872e2d4b8b46e6d412dae592e89480fc668c/git] a topology can be corrupted without exception by using TopoGeo_addLinestring. Test attached. This is a spin-off of #6062 Full version: {{{ POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" [EXTENSION] PGSQL="180" GEOS="3.14.2dev-CAPI-1.20.5" PROJ="9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)" TOPOLOGY }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 00:25:21 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:25:21 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.a033d2d1e74090c3ff00b27276cb2e3e@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * Attachment "error_test_38_1_4.sql" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 00:26:25 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:26:25 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.2bb6060ace125793242956414ef89532@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Comment (by strk): I can actually reproduce the silent topology corruption with current master branch, I filed #6064 for that. Will try the version you reported (3b3488ddf) and update that ticket. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 00:30:10 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:30:10 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.fd4b295755e14ce9f58d22b9fcc4a230@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): I can also reproduce with the version reported by Lars as working: {{{ PostgreSQL 18.3 (Debian 18.3-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit Postgis 3.7.0dev - (3.6.0rc2-305-g3b3488ddf) - 2026-04-07 07:27:12 GEOS: 3.14.2dev-CAPI-1.20.5 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 00:41:02 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:41:02 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.a5f977ff4cbdba7091fd6225d1cc8762@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): Passing 0 as the tolerance to the last `TopoGeo_addLinestring` prevents the silent corruption. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 00:59:47 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 07:59:47 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.7361acd68250ef5c90de42dc3925eb90@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * Attachment "t6064.sql" added. Simplified testcase -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 01:15:56 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 08:15:56 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.87d460a3a4c2647936827f6b0e544643@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): The resulting topology contains edges that are very short: {{{ postgis_reg=# select edge_id, ST_Length(geom) from t6064.edge; edge_id | st_length ---------+------------------------ 6 | 0.20166820447100725 1 | 2.5110321484918296e-07 4 | 2.5110321655621793e-07 3 | 0.2017140909558352 2 | 3.1201241416250513e-13 5 | 3.6487597516463005e-13 }}} The computed snap tolerance (when NOT passing 0 as the tolerance) is `2.48862579345703e-13` so those tiny edges are still longer than tolerance. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 01:53:20 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 08:53:20 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.a8c8ca7a8c0ab44213af71e9e0f333cc@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by Lars Aksel Opsahl): * cc: Lars Aksel Opsahl (added) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 03:29:58 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:29:58 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.1097709c6b712e245b695e80ffe13bf7@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * Attachment "screen.png" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 03:37:47 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:37:47 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.5d7ec3d24663529ef6512f696839bac8@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): I've further reduced the test to pre-split the incoming line into the 3 edges that would result by the internal splitting, and added each one in turn, until I got the exception. Unfortunately I found that even BEFORE ValidateTopology reports an error, there is already a clear error, as you can see from this picture, there's a "face 2" reported to be on the left and right sides of an edge that should have the universe face there instead. This means the corruption happens BEFORE ValidateTopology can tell. [[Image(screen.png)]] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 03:40:29 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:40:29 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.77a6d07ed62b345b40b1fcad7000f81c@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): That worked, thanks. I have just uploaded the compressed data set and the script to create the table. To reproduce just run {{{ psql -f gf_active_play_area.sql -h host db user }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 03:45:57 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:45:57 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling Message-ID: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling ----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Keywords: | ----------------------+--------------------------- As reported in https://trac.osgeo.org/postgis/ticket/6064#comment:5 we have a case in which ValidateTopology fails to find bogus left_face and right_face labeling. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 03:59:40 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 10:59:40 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.TopoGeo_addLinestring In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.429582bd2698161f18d02b7cc9ea21e9@osgeo.org> #6064: Silent topology corruption with topology.TopoGeo_addLinestring -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Comment (by strk): I filed #6065 for the problem of ValidateTopology not seeing the problem eariler -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 07:51:41 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 14:51:41 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.f4586c17387ec35392275081bc67741c@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Test: {{{ SELECT NULL FROM topology.CreateTopology ('t6065'); INSERT INTO t6065.node (node_id, geom) VALUES ( 1, 'POINT(17.42207545158684 69.11091383590066)' ), ( 2, 'POINT(17.622976580401446 69.12848944101118)' ), ( 3, 'POINT(17.42207545158653 69.11091383590062)' ), ( 4, 'POINT(17.422075702665087 69.11091383235977)' ); INSERT INTO t6065.face (face_id, mbr) VALUES ( 1, 'POLYGON((17.42207545158684 69.11091383235974,17.42207545158684 69.11091383590066,17.422075702665087 69.11091383590066,17.422075702665087 69.11091383235974,17.42207545158684 69.11091383235974))' ), ( 2, 'POLYGON((17.42207545158653 69.11091383235974,17.42207545158653 69.12848944101118,17.622976580401446 69.12848944101118,17.622976580401446 69.11091383235974,17.42207545158653 69.11091383235974))' ); INSERT INTO t6065.edge (edge_id,start_node,end_node,next_left_edge,next_right_edge,left_face,right_face,geom) VALUES ( 1,1,4,3,4,2,1,'LINESTRING(17.42207545158684 69.11091383590066,17.422075702665087 69.11091383235977)' ), ( 2,3,1,1,2,2,2,'LINESTRING(17.42207545158653 69.11091383590062,17.42207545158684 69.11091383590066)' ), ( 3,4,2,-3,-4,2,2,'LINESTRING(17.422075702665087 69.11091383235977,17.579930758184094 69.12294910230447,17.622976580401446 69.12848944101118)' ), ( 4,1,4,-1,-2,1,2,'LINESTRING(17.42207545158684 69.11091383590066,17.42207570266477 69.11091383235974,17.422075702665087 69.11091383235977)' ); SELECT 'invalidities', * FROM topology.ValidateTopology('t6065'); }}} The problem is with computing winding order of rings, in presence of dangling edges. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 08:41:42 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 15:41:42 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace (was: Silent topology corruption with topology.TopoGeo_addLinestring) In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.24ae5f0ed26a94a6e7ecf58f17e0f36b@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+-------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------- Changes (by strk): * summary: Silent topology corruption with topology.TopoGeo_addLinestring => Silent topology corruption with topology.ST_AddEdgeModFace Old description: > As of commit [67ff872e2d4b8b46e6d412dae592e89480fc668c/git] a topology > can be corrupted without exception by using TopoGeo_addLinestring. > > Test attached. > > This is a spin-off of #6062 > > Full version: > {{{ > POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" [EXTENSION] PGSQL="180" > GEOS="3.14.2dev-CAPI-1.20.5" PROJ="9.6.0 NETWORK_ENABLED=OFF > URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj > DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) > LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 > (Internal)" TOPOLOGY > }}} New description: As of commit [67ff872e2d4b8b46e6d412dae592e89480fc668c/git] a topology can be corrupted without exception by using ST_AddEdgeModFace. Test attached. This is a spin-off of #6062 Full version: {{{ POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" [EXTENSION] PGSQL="180" GEOS="3.14.2dev-CAPI-1.20.5" PROJ="9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)" TOPOLOGY }}} -- Comment: Further simplification of the test, completely removing the code that takes care of noding. This one ONLY uses `ST_AddEdgeModFace`: {{{ SELECT NULL FROM topology.CreateTopology ('t6064'); SELECT topology.ST_AddIsoNode('t6064', 0, 'POINT(17.42207545158684 69.11091383590066)'); -- n1 SELECT topology.ST_AddIsoNode('t6064', 0, 'POINT(17.622976580401446 69.12848944101118)'); -- n2 SELECT topology.ST_AddIsoNode('t6064', 0, 'POINT(17.42207545158653 69.11091383590062)'); -- n3 SELECT 't6064.1', count(*) FROM topology.ST_AddEdgeModFace('t6064', 1, 2, 'LINESTRING( 17.42207545158684 69.11091383590066, 17.422075702665087 69.11091383235977, 17.579930758184094 69.12294910230447, 17.622976580401446 69.12848944101118 )'); SELECT 't6064.2', count(*) FROM topology.ST_AddEdgeModFace('t6064', 3,1, 'LINESTRING( 17.42207545158653 69.11091383590062, 17.42207545158684 69.11091383590066 )'); -- valid thus far -- Silently corrupts topology, updating edge 1 side faces as it thinks -- left side is a new face (it isn't). -- The code finds rings on BOTH sides of this new edge to be counterclockwise -- but instead only one side of them is. -- -- This is likely due to the presence of very long dangling edges. -- SELECT 't6064.3', count(*) FROM topology.ST_AddEdgeModFace('t6064', 1, 3, 'LINESTRING( 17.42207545158684 69.11091383590066, 17.42207570266477 69.11091383235974, 17.42207545158653 69.11091383590062 )' ); }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 08:43:25 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 15:43:25 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.d82ea1007b6770fbee3ae28b303ba60e@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Changes (by strk): * keywords: => robustness Comment: Note that the topology corruption introduced will NOT be detected by ValidateTopology, but is easily spotted by looking at the left/right face labels of the longest edge which are clearly wrong. The lack of reporting by ValidateTopology is handled in #6065 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 10:25:08 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 17:25:08 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test Message-ID: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> #6066: Pg19 + topology crash on regression test ---------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Keywords: | ---------------------+--------------------------- In the `topology/test/regress/droptopogeometrycolumn.sql` test set, the line below causes a backend crash in Pg19 of recent vintage. First observed in CI some time after April 2, the last good build. {{{ INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1); WARNING: resource was not closed: relation "node" WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "node" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: relation "node_primary_key" WARNING: resource was not closed: relation "node_primary_key" WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "face" WARNING: resource was not closed: TupleDesc 0xc194f1d60 (42565,-1) WARNING: resource was not closed: TupleDesc 0xc194f1d60 (42565,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194f2e60 (42591,-1) WARNING: resource was not closed: TupleDesc 0xc194e68b0 (42575,-1) WARNING: resource was not closed: TupleDesc 0xc194e68b0 (42575,-1) WARNING: resource was not closed: TupleDesc 0xc194e68b0 (42575,-1) WARNING: resource was not closed: TupleDesc 0xc194f1d60 (42565,-1) server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 10:40:30 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 17:40:30 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.4dbd12cd254ee84220b7fcb28006d262@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): Backtrace at point of crash does not provide much guidance {{{ * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT * frame #0: 0x0000000182e545e8 libsystem_kernel.dylib`__pthread_kill + 8 frame #1: 0x0000000182e8f8d8 libsystem_pthread.dylib`pthread_kill + 296 frame #2: 0x0000000182d96790 libsystem_c.dylib`abort + 148 frame #3: 0x000000010460c0f0 postgres`ExceptionalCondition(conditionName=, fileName=, lineNumber=2192) at assert.c:65:2 [opt] frame #4: 0x00000001045ffa5c postgres`RelationDecrementReferenceCount(rel=) at relcache.c:2192:2 [opt] [inlined] frame #5: 0x00000001045ffa44 postgres`RelationClose(relation=) at relcache.c:2213:2 [opt] frame #6: 0x000000010414c8d8 postgres`index_close(relation=, lockmode=0) at indexam.c:185:2 [opt] frame #7: 0x000000010459f2dc postgres`ri_FastPathTeardown at ri_triggers.c:4152:4 [opt] [inlined] frame #8: 0x000000010459f298 postgres`ri_FastPathEndBatch(arg=) at ri_triggers.c:4130:2 [opt] frame #9: 0x000000010429b24c postgres`FireAfterTriggerBatchCallbacks at trigger.c:6861:3 [opt] frame #10: 0x000000010429b208 postgres`AfterTriggerEndQuery(estate=) at trigger.c:5240:2 [opt] frame #11: 0x00000001042c1000 postgres`standard_ExecutorFinish(queryDesc=0x0000000c1914a900) at execMain.c:445:3 [opt] frame #12: 0x00000001042c0f18 postgres`ExecutorFinish(queryDesc=) at execMain.c:413:3 [opt] [artificial] frame #13: 0x00000001044c40dc postgres`ProcessQuery(plan=0x0000000c190078d0, sourceText="INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1);", params=0x0000000000000000, queryEnv=0x0000000000000000, dest=0x0000000c18ca9110, qc=0x000000016bd1d968) at pquery.c:189:2 [opt] frame #14: 0x00000001044c36b0 postgres`PortalRunMulti(portal=0x0000000c19022100, isTopLevel=true, setHoldSnapshot=false, dest=0x0000000c18ca9110, altdest=0x0000000c18ca9110, qc=0x000000016bd1d968) at pquery.c:0 [opt] frame #15: 0x00000001044c3044 postgres`PortalRun(portal=0x0000000c19022100, count=9223372036854775807, isTopLevel=, dest=0x0000000c18ca9110, altdest=0x0000000c18ca9110, qc=0x000000016bd1d968) at pquery.c:783:5 [opt] frame #16: 0x00000001044c2054 postgres`exec_simple_query(query_string="INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1);") at postgres.c:1288:10 [opt] frame #17: 0x00000001044bf300 postgres`PostgresMain(dbname=, username=) at postgres.c:0:24 [opt] frame #18: 0x00000001044bad5c postgres`BackendMain(startup_data=, startup_data_len=) at backend_startup.c:124:2 [opt] frame #19: 0x0000000104404ba4 postgres`postmaster_child_launch(child_type=, child_slot=1, startup_data=0x000000016bd1e7f0, startup_data_len=24, client_sock=0x000000016bd1dd60) at launch_backend.c:265:3 [opt] frame #20: 0x0000000104408fec postgres`BackendStartup(client_sock=0x000000016bd1dd60) at postmaster.c:3627:8 [opt] [inlined] frame #21: 0x0000000104408f18 postgres`ServerLoop at postmaster.c:1722:6 [opt] frame #22: 0x0000000104406f9c postgres`PostmasterMain(argc=, argv=) at postmaster.c:1412:11 [opt] frame #23: 0x000000010431c904 postgres`main(argc=3, argv=0x00000001065fe870) at main.c:231:4 [opt] frame #24: 0x0000000182ad3da4 dyld`start + 6992 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 11:53:35 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 18:53:35 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.89ca4c1fa48898bd8082b9cbc1310e48@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by Lars Aksel Opsahl): * cc: Lars Aksel Opsahl (added) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 7 12:20:22 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 7 Apr 2026 12:20:22 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-431-g3c92f0325 Message-ID: <20260407192022.4EAA1191763@trac.osgeo.org> 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 3c92f0325b9fc6b2aa056cc6272cd0acb79626f8 (commit) from 8cfe6fe6de8906da79047f15d4a340a775aa1f51 (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 3c92f0325b9fc6b2aa056cc6272cd0acb79626f8 Author: Sandro Santilli Date: Tue Apr 7 21:20:09 2026 +0200 Make function definition more readable diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in index 3611de981..4dff69603 100644 --- a/topology/sql/manage/ValidateTopology.sql.in +++ b/topology/sql/manage/ValidateTopology.sql.in @@ -35,7 +35,7 @@ CREATE TYPE topology.ValidateTopology_ReturnType AS ( -- Availability: 3.6.0 -- Changed: 3.6.0 uses bigint for IDs -- Replaces _validatetopologygetfaceshellmaximaledgering(varchar, integer) deprecated in 3.6.0 -CREATE OR REPLACE FUNCTION topology._validatetopologygetfaceshellmaximaledgering(atopology varchar, aface bigint) +CREATE OR REPLACE FUNCTION topology._ValidateTopologyGetFaceShellMaximalEdgeRing(atopology varchar, aface bigint) RETURNS GEOMETRY AS $BODY$ DECLARE ----------------------------------------------------------------------- Summary of changes: topology/sql/manage/ValidateTopology.sql.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 7 12:36:50 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 19:36:50 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.05f8a87c20107935fbdc481d3310ff4a@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Using a `long double` instead of a `double` in the signed-area function fixes this case, making ST_IsPolygonCCW more robust. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 12:37:56 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 19:37:56 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.83222a3b50b6c60d754386497da3689d@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Comment (by strk): Using a `long double` instead of a `double` in the signed-area function fixes this case, making `ptarray_isccw` more robust. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 14:03:56 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 21:03:56 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.865e4ff419a90907d18eb1ecf5e6dab1@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The problem is that due to the numerical limit in `ST_IsPolygonCCW`, the 2 rings in the topology are both considered shells (both CCW) and none is considered an hole. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 14:57:46 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 21:57:46 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.effc8f78365af2d21cde25ade361621e@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The `long double` fix is in https://gitea.osgeo.org/postgis/postgis/pulls/290 with the associated regression test -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 15:36:50 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 22:36:50 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.0242decdecb52ac937bfdb1812dfb491@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): From the test, here is the crash sequence {{{ -- Drop corrupted topology (with missing layer sequence) -- See http://trac.osgeo.org/postgis/ticket/5118 SELECT NULL FROM topology.CreateTopology('t5118'); CREATE TABLE t5118f (id int); SELECT NULL FROM topology.AddTopoGeometryColumn('t5118', 'public', 't5118f', 'g', 'LINE'); INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1); }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 15:43:14 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 07 Apr 2026 22:43:14 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.e4a29a579c685164f8a249fa0837db33@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): How I am exercising this {{{ # clean database dropdb postgis_reg ./regress/run_test.pl --nodrop --topology ./regress/core/wkt psql postgis_reg }}} Setup the scenario {{{ SELECT NULL FROM topology.CreateTopology('t5118'); CREATE TABLE t5118f (id int); SELECT NULL FROM topology.AddTopoGeometryColumn('t5118', 'public', 't5118f', 'g', 'LINE'); }}} Hit the red buttton {{{ INSERT INTO t5118f(g) SELECT toTopoGeom('LINESTRING(0 0, 10 0)', 't5118', 1); }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 7 21:36:56 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 04:36:56 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.a30bec1a4edf4c5b545f2db0c89c5e0b@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): It's not crashing for Paul but he is getting an invalid geometry {{{ ERROR: parse error - invalid geometry HINT: "..." <-- parse error at position 1131025 within geometry CONTEXT: COPY gf_active_play_area, line 596, column shape: "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.4676..." }}} So I suppose related to a corrupt geometry. For me it crashes somewhere in the strncat() parsing function so very low level in my msvcrt. I'm running on windows / mingw64/msys. I haven't tried one of my Linux boxes yet. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 01:55:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 01:55:45 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-432-g7e3d523cd Message-ID: <20260408085545.A57D41942EF@trac.osgeo.org> 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 7e3d523cda37faa3efdb8daed91e73df6a9fe864 (commit) from 3c92f0325b9fc6b2aa056cc6272cd0acb79626f8 (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 7e3d523cda37faa3efdb8daed91e73df6a9fe864 Author: Sandro Santilli Date: Tue Apr 7 23:53:43 2026 +0200 Use long double during signed area computation, improving robustness Fixes #6065 in 3.7.0dev Includes regression test diff --git a/NEWS b/NEWS index a0a1146c4..5d3de8494 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,11 @@ This version requires GEOS 3.10 or higher - #2614, Use GEOSPreparedDistance and caching to accelerate ST_DWithin (Paul Ramsey) - GH-839, ST_Multi support for TIN and surfaces (Lo?c Bartoletti) +* Enhancements * + + - #6065, Improved winding order computation robustness for rings having collapsed elements + (Sandro Santilli) + * Bug Fixes * - Build PostgreSQL extension modules with `-fno-semantic-interposition` when diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 54cfe875e..df5782adb 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1080,7 +1080,7 @@ ptarray_signed_area(const POINTARRAY *pa) const POINT2D *P1; const POINT2D *P2; const POINT2D *P3; - double sum = 0.0; + long double sum = 0.0; double x0, x, y1, y2; uint32_t i; diff --git a/topology/test/regress/validatetopology.sql b/topology/test/regress/validatetopology.sql index 173e4a5b1..aa852bb0d 100644 --- a/topology/test/regress/validatetopology.sql +++ b/topology/test/regress/validatetopology.sql @@ -222,3 +222,24 @@ ROLLBACK; SELECT NULL FROM topology.DropTopology('city_data'); +-- See https://trac.osgeo.org/postgis/ticket/6065 +BEGIN; +SELECT NULL FROM topology.CreateTopology ('t6065'); +INSERT INTO t6065.node (node_id, geom) VALUES +( 1, 'POINT(17.42207545158684 69.11091383590066)' ), +( 2, 'POINT(17.622976580401446 69.12848944101118)' ), +( 3, 'POINT(17.42207545158653 69.11091383590062)' ), +( 4, 'POINT(17.422075702665087 69.11091383235977)' ); +INSERT INTO t6065.face (face_id, mbr) +VALUES +( 1, 'POLYGON((17.42207545158684 69.11091383235974,17.42207545158684 69.11091383590066,17.422075702665087 69.11091383590066,17.422075702665087 69.11091383235974,17.42207545158684 69.11091383235974))' ), +( 2, 'POLYGON((17.42207545158653 69.11091383235974,17.42207545158653 69.12848944101118,17.622976580401446 69.12848944101118,17.622976580401446 69.11091383235974,17.42207545158653 69.11091383235974))' ); +INSERT INTO t6065.edge (edge_id,start_node,end_node,next_left_edge,next_right_edge,left_face,right_face,geom) +VALUES +( 1,1,4,3,4,2,1,'LINESTRING(17.42207545158684 69.11091383590066,17.422075702665087 69.11091383235977)' ), +( 2,3,1,1,2,2,2,'LINESTRING(17.42207545158653 69.11091383590062,17.42207545158684 69.11091383590066)' ), +( 3,4,2,-3,-4,2,2,'LINESTRING(17.422075702665087 69.11091383235977,17.579930758184094 69.12294910230447,17.622976580401446 69.12848944101118)' ), +( 4,1,4,-1,-2,1,2,'LINESTRING(17.42207545158684 69.11091383590066,17.42207570266477 69.11091383235974,17.422075702665087 69.11091383235977)' ); +SELECT '#6065', 'invalidities', * FROM topology.ValidateTopology('t6065'); +ROLLBACK; + diff --git a/topology/test/regress/validatetopology_expected b/topology/test/regress/validatetopology_expected index da497ee20..5f667e048 100644 --- a/topology/test/regress/validatetopology_expected +++ b/topology/test/regress/validatetopology_expected @@ -46,3 +46,4 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| +#6065|invalidities|hole not in advertised face|-4| ----------------------------------------------------------------------- Summary of changes: NEWS | 5 +++++ liblwgeom/ptarray.c | 2 +- topology/test/regress/validatetopology.sql | 21 +++++++++++++++++++++ topology/test/regress/validatetopology_expected | 1 + 4 files changed, 28 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 01:56:01 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 08:56:01 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.6fdc35d4b231d02eb9f6d7a26ff7cedd@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: fixed | Keywords: -----------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"7e3d523cda37faa3efdb8daed91e73df6a9fe864/git" 7e3d523/git]: {{{#!CommitTicketReference repository="git" revision="7e3d523cda37faa3efdb8daed91e73df6a9fe864" Use long double during signed area computation, improving robustness Fixes #6065 in 3.7.0dev Includes regression test }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 02:08:42 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 02:08:42 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-433-gcf42b890b Message-ID: <20260408090843.1C13219534E@trac.osgeo.org> 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 cf42b890bf892d5498af532f1e8804355b44e71d (commit) from 7e3d523cda37faa3efdb8daed91e73df6a9fe864 (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 ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/topo/lwgeom_topo.c | 31 ++-------------------- topology/test/regress/topogeo_addlinestring.sql | 25 +++++++++++++++++ .../test/regress/topogeo_addlinestring_expected | 1 + 4 files changed, 29 insertions(+), 29 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 02:08:45 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 09:08:45 -0000 Subject: [PostGIS] #6062: More error XX000: SQL/MM Spatial exception - geometry In-Reply-To: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> References: <050.cc9979242e6c0270b720ad1663c50b41@osgeo.org> Message-ID: <065.517fb650f0cca8bd22ae5daa1039e34f@osgeo.org> #6062: More error XX000: SQL/MM Spatial exception - geometry --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: topology | Version: 3.6.x Resolution: fixed | Keywords: --------------------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"cf42b890bf892d5498af532f1e8804355b44e71d/git" cf42b89/git]: {{{#!CommitTicketReference repository="git" revision="cf42b890bf892d5498af532f1e8804355b44e71d" Stop using recursive snapping during topology building Fixes #6062 Includes regression test }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 02:23:04 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 02:23:04 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-434-gacc6afbd9 Message-ID: <20260408092304.83B0B1956B4@trac.osgeo.org> 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 acc6afbd9212beaf8e2039c7f2369584a6c9ec77 (commit) from cf42b890bf892d5498af532f1e8804355b44e71d (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 acc6afbd9212beaf8e2039c7f2369584a6c9ec77 Author: Sandro Santilli Date: Thu Jan 29 11:33:51 2026 +0100 FindVertexSegmentPairsBelowDistance function References #6034 Includes tests and documentation diff --git a/NEWS b/NEWS index 19c16e4bc..1a59e317b 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ This version requires GEOS 3.10 or higher * New Features * + - [topology] FindVertexSegmentPairsBelowDistance function (Sandro Santilli) - ST_CoverageEdges, returns MultiLinestring of distinct shared edges in polygonal coverage (Paul Ramsey) - ST_MinimumSpanningTree, window function to calculate MST (Paul Ramsey) diff --git a/doc/extras_topology.xml b/doc/extras_topology.xml index 4b0aa308a..31fe66eaf 100644 --- a/doc/extras_topology.xml +++ b/doc/extras_topology.xml @@ -3313,6 +3313,47 @@ and is thus usable to build edge ring linking. + + + FindVertexSegmentPairsBelowDistance + + + Find pairs of topology vertex/segment that are closer than tolerated distance + + + + + + + setof record FindVertexSegmentPairsBelowDistance + varchar atopology + float8 tolerance + + + + + + Description + + +Returns a relation in which each tuple is a pair of vertex/segment where +the vertex is NOT an endpoint of the segment but the distance between +them is below the given tolerance. + + + + Availability: 3.7 + + + + + See Also + + + + + + diff --git a/topology/Makefile.in b/topology/Makefile.in index 25cae0bfa..3319cf98c 100644 --- a/topology/Makefile.in +++ b/topology/Makefile.in @@ -130,12 +130,13 @@ topology.sql: \ sql/polygonize.sql.in \ sql/export/gml.sql.in \ sql/export/TopoJSON.sql.in \ - sql/query/getnodebypoint.sql.in \ + sql/query/FindVertexSegmentPairsBelowDistance.sql.in \ sql/query/getedgebypoint.sql.in \ sql/query/getfacebypoint.sql.in \ - sql/query/GetRingEdges.sql.in \ - sql/query/GetNodeEdges.sql.in \ sql/query/GetFaceContainingPoint.sql.in \ + sql/query/getnodebypoint.sql.in \ + sql/query/GetNodeEdges.sql.in \ + sql/query/GetRingEdges.sql.in \ sql/manage/AddTopoGeometryColumn.sql.in \ sql/manage/CopyTopology.sql.in \ sql/manage/CreateTopology.sql.in \ diff --git a/topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in b/topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in new file mode 100644 index 000000000..8d5096235 --- /dev/null +++ b/topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in @@ -0,0 +1,46 @@ +-- Finds pairs of vertice/segment from a topology that are below a given distance. +-- The vertex must NOT be part of the segment. +-- +-- Presence of such proximities represent a missed snap opportunity during topology building +-- and can sometime be fixed by adding a new node where the vertex is, like: +-- +-- SELECT topology.TopoGeo_AddPoint('topo', ST_PointN(geom,v.vert)) +-- FROM topo.edge, LATERAL topology.findVertexSegmentPairsBelowDistance('topo', 1e-6) v +-- WHERE edge_id = v.vert_edge; +-- +CREATE OR REPLACE FUNCTION topology.findVertexSegmentPairsBelowDistance(toponame varchar, tolerance float8) +RETURNS TABLE (seg_edge int, segno int, vert_edge int, vertno int, vert_geom geometry) +AS $BODY$ +DECLARE + sql text; +BEGIN + sql := format($$ + SELECT + e1.edge_id seg_edge, + s.path[1] segno, + e2.edge_id vert_edge, + p.path[1] vertno, + p.geom vert_geom + FROM + %1$I.edge e1, + %1$I.edge e2, + LATERAL ST_DumpSegments(e1.geom) s, + LATERAL ST_DumpPoints(e2.geom) p + WHERE + e1.edge_id != e2.edge_id + AND ST_Expand(e1.geom, %2$L) && e2.geom + AND ST_Distance(s.geom, p.geom) < %2$L + AND NOT ( + ST_Equals(p.geom, ST_PointN(s.geom, 1)) + OR + ST_Equals(p.geom, ST_PointN(s.geom, 2)) + ) + $$, + toponame, + tolerance + ); + + RETURN QUERY EXECUTE sql; +END; +$BODY$ +LANGUAGE 'plpgsql'; diff --git a/topology/test/regress/findvertexsegmentpairsbelowdistance.sql b/topology/test/regress/findvertexsegmentpairsbelowdistance.sql new file mode 100644 index 000000000..ac3aac9b0 --- /dev/null +++ b/topology/test/regress/findvertexsegmentpairsbelowdistance.sql @@ -0,0 +1,11 @@ +\set VERBOSITY terse +set client_min_messages to ERROR; + +\i :top_builddir/topology/test/load_topology.sql + +SELECT 't1', 'count', count(*) FROM topology.FindVertexSegmentPairsBelowDistance('city_data', 1); +SELECT 't2', seg_edge, segno, vert_edge, vertno, ST_AsText(vert_geom) +FROM topology.FindVertexSegmentPairsBelowDistance('city_data', 1.1) +ORDER BY 1,2,3,4; + +SELECT NULL FROM topology.DropTopology('city_data'); diff --git a/topology/test/regress/findvertexsegmentpairsbelowdistance_expected b/topology/test/regress/findvertexsegmentpairsbelowdistance_expected new file mode 100644 index 000000000..000575dbb --- /dev/null +++ b/topology/test/regress/findvertexsegmentpairsbelowdistance_expected @@ -0,0 +1,12 @@ +t1|count|0 +t2|1|1|2|5|POINT(17 30) +t2|1|2|2|5|POINT(17 30) +t2|1|4|26|1|POINT(4 31) +t2|1|4|26|4|POINT(4 34) +t2|1|4|26|5|POINT(4 31) +t2|1|5|26|1|POINT(4 31) +t2|1|5|26|2|POINT(7 31) +t2|1|5|26|5|POINT(4 31) +t2|2|4|1|2|POINT(16 30) +t2|2|4|1|3|POINT(16 38) +t2|2|5|1|2|POINT(16 30) diff --git a/topology/test/tests.mk b/topology/test/tests.mk index ba1d2e204..3c70599d7 100644 --- a/topology/test/tests.mk +++ b/topology/test/tests.mk @@ -99,5 +99,6 @@ TESTS += \ $(top_srcdir)/topology/test/regress/validatetopology.sql \ $(top_srcdir)/topology/test/regress/validatetopology_large.sql \ $(top_srcdir)/topology/test/regress/verifylargeids.sql \ - $(top_srcdir)/topology/test/regress/fix_topogeometry_columns.sql + $(top_srcdir)/topology/test/regress/fix_topogeometry_columns.sql \ + $(top_srcdir)/topology/test/regress/findvertexsegmentpairsbelowdistance.sql diff --git a/topology/topology.sql.in b/topology/topology.sql.in index c364af34d..e96d9068e 100644 --- a/topology/topology.sql.in +++ b/topology/topology.sql.in @@ -1379,6 +1379,7 @@ LANGUAGE 'plpgsql' VOLATILE STRICT; #include "sql/query/getedgebypoint.sql.in" #include "sql/query/getfacebypoint.sql.in" #include "sql/query/GetFaceContainingPoint.sql.in" +#include "sql/query/FindVertexSegmentPairsBelowDistance.sql.in" -- Populating #include "sql/populate.sql.in" ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + doc/extras_topology.xml | 41 +++++++++++++++++++ topology/Makefile.in | 7 ++-- .../FindVertexSegmentPairsBelowDistance.sql.in | 46 ++++++++++++++++++++++ .../findvertexsegmentpairsbelowdistance.sql | 11 ++++++ .../findvertexsegmentpairsbelowdistance_expected | 12 ++++++ topology/test/tests.mk | 3 +- topology/topology.sql.in | 1 + 8 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 topology/sql/query/FindVertexSegmentPairsBelowDistance.sql.in create mode 100644 topology/test/regress/findvertexsegmentpairsbelowdistance.sql create mode 100644 topology/test/regress/findvertexsegmentpairsbelowdistance_expected hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 02:23:06 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 09:23:06 -0000 Subject: [PostGIS] #6034: Missing node when adding overlapping line In-Reply-To: <050.00fe4cf3809caf26d3d25a602c774226@osgeo.org> References: <050.00fe4cf3809caf26d3d25a602c774226@osgeo.org> Message-ID: <065.2393f9ae7b4c045d8990cbd2cf322e41@osgeo.org> #6034: Missing node when adding overlapping line --------------------------------+------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: defect | Status: new Priority: medium | Milestone: Component: topology | Version: 3.6.x Resolution: | Keywords: --------------------------------+------------------- Comment (by Sandro Santilli ): In [changeset:"acc6afbd9212beaf8e2039c7f2369584a6c9ec77/git" acc6afbd/git]: {{{#!CommitTicketReference repository="git" revision="acc6afbd9212beaf8e2039c7f2369584a6c9ec77" FindVertexSegmentPairsBelowDistance function References #6034 Includes tests and documentation }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 02:57:38 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 09:57:38 -0000 Subject: [PostGIS] #1502: Unrobustness in distance calculations In-Reply-To: <049.6e99c90e0fdd841800c1505295190a4c@osgeo.org> References: <049.6e99c90e0fdd841800c1505295190a4c@osgeo.org> Message-ID: <064.cccdee629f57588f3d5bbaaa43d3899e@osgeo.org> #1502: Unrobustness in distance calculations ----------------------+--------------------------- Reporter: nicklas | Owner: nicklas Type: defect | Status: closed Priority: medium | Milestone: PostGIS 2.0.0 Component: postgis | Version: 1.5.X Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by strk): for the record, the test for this started failing at some point, see https://gitlab.com/postgis/postgis/-/jobs/13826180367#L2607 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 03:28:46 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 03:28:46 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-435-g2c9277d3d Message-ID: <20260408102846.C2C78195FAE@trac.osgeo.org> 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 2c9277d3da0794f44dee60107d107cfd9939edeb (commit) from acc6afbd9212beaf8e2039c7f2369584a6c9ec77 (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 2c9277d3da0794f44dee60107d107cfd9939edeb Author: Sandro Santilli Date: Wed Apr 8 12:27:36 2026 +0200 Add topology test for ticket 6064 The test would fail if we reverted commit 7e3d523cda37faa3efdb8daed91e73df6a9fe864 Closes #6064 diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql index aadf897f6..f54145537 100644 --- a/topology/test/regress/topogeo_addlinestring.sql +++ b/topology/test/regress/topogeo_addlinestring.sql @@ -630,3 +630,26 @@ SELECT 't6062.edges', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6062', ORDER BY 2; SELECT 't6062.2', 'error', * FROM topology.ValidateTopology('t6062') v; SELECT NULL FROM topology.DropTopology ('t6062'); + +-- See https://trac.osgeo.org/postgis/ticket/6064 +set client_min_messages to WARNING; +SELECT NULL FROM topology.CreateTopology ('t6064'); +SELECT 't6064.1', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', +'LINESTRING( + 17.42207545158684 69.11091383590066, + 17.422075702665087 69.11091383235977, + 17.579930758184094 69.12294910230447 + , 17.622976580401446 69.12848944101118 +)'); + +SELECT 't6064.check.intermediate', * FROM topology.ValidateTopology('t6064'); +set client_min_messages to DEBUG; +SELECT 't6064.2', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', +'LINESTRING( + 17.42207545158653 69.11091383590062, + 17.42207570266477 69.11091383235974, + 17.622976580401076 69.12848944101118 +)'); +set client_min_messages to WARNING; +SELECT 't6064.check.final', * FROM topology.ValidateTopology('t6064'); +SELECT NULL FROM topology.DropTopology ('t6064'); diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected index 5ef1bb81a..a698decff 100644 --- a/topology/test/regress/topogeo_addlinestring_expected +++ b/topology/test/regress/topogeo_addlinestring_expected @@ -234,3 +234,5 @@ ERROR: Adding line to topology requires creating more edges than the requested t6023.1|errors| t6023.2|errors| t6062.edges|t +t6064.1|t +t6064.2|t ----------------------------------------------------------------------- Summary of changes: topology/test/regress/topogeo_addlinestring.sql | 23 ++++++++++++++++++++++ .../test/regress/topogeo_addlinestring_expected | 2 ++ 2 files changed, 25 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 03:28:48 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 10:28:48 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.b6c982dd9e7ae309459ad8b37700b55a@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: Component: topology | Version: master Resolution: fixed | Keywords: robustness -----------------------+------------------------ Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"2c9277d3da0794f44dee60107d107cfd9939edeb/git" 2c9277d3/git]: {{{#!CommitTicketReference repository="git" revision="2c9277d3da0794f44dee60107d107cfd9939edeb" Add topology test for ticket 6064 The test would fail if we reverted commit 7e3d523cda37faa3efdb8daed91e73df6a9fe864 Closes #6064 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 06:32:46 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 13:32:46 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.c0cf3cf6654fe8e84064d10762641dac@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by robe): Here is the backtrace: {{{ #0 0x00007fff9380b91e in strncat () from C:\WINDOWS\System32\msvcrt.dll #1 0x00007ffef562e04d in lwmessage_truncate ( str=0x229f2af816d "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.46761900 46.63984000, 15.46857900 46.63916700, 15.46950600 46.63848600, 15.47039300 46.63779600, 15.4712"..., startpos=startpos at entry=0, endpos=1131024, maxlength=maxlength at entry=40, truncdirection=truncdirection at entry=0) at lwutil.c:299 #2 0x00007ffef55fb5b0 in pg_parser_errhint (lwg_parser_result=lwg_parser_result at entry=0x9b3f7ff1f0) at lwgeom_pg.c:290 #3 0x00007ffef55b0cf8 in LWGEOM_in (fcinfo=0x9b3f7ff290) at lwgeom_inout.c:164 #4 0x00007ff7a5d70433 in InputFunctionCallSafe (flinfo=0x229f0959580, str=0x229f2af816d "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.46761900 46.63984000, 15.46857900 46.63916700, 15.46950600 46.63848600, 15.47039300 46.63779600, 15.4712"..., typioparam=, typmod=, escontext=0x0, result=0x229f09511c0) at fmgr.c:1607 #5 0x00007ff7a59a2070 in CopyFromTextLikeOneRow (is_csv=false, nulls=0x229f09511c8, values=, econtext=, cstate=0x229f0965c48) at copyfromparse.c:1029 #6 CopyFromTextOneRow (cstate=, econtext=, values=0x229f0951158, nulls=0x229f09511c8) at copyfromparse.c:919 #7 0x00007ff7a59a1d7b in NextCopyFrom (cstate=cstate at entry=0x229f0965c48, econtext=econtext at entry=0x229f0952fc0, values=0x229f0951158, nulls=0x229f09511c8) at copyfromparse.c:890 #8 0x00007ff7a599e78a in CopyFrom (cstate=cstate at entry=0x229f0965c48) at copyfrom.c:1149 #9 0x00007ff7a599d2be in DoCopy (pstate=0x229f08c9bd0, stmt=0x229f0949d50, stmt_location=0, stmt_len=183, processed=0x9b3f7ff6e8) at copy.c:306 #10 0x00007ff7a5c1ea0e in standard_ProcessUtility (pstmt=0x229f0949e20, queryString=0x229f0948d60 "COPY foo.gf_active_play_area (objectid,ap_id,play_id,playname,basin_id,basin_name,description,playbasin_name,age_base_ma,age_base_name,age_top_ma,age_top_name,mapped,shape) FROM STDIN;", readOnlyTree=, context=PROCESS_UTILITY_TOPLEVEL, params=0x0, queryEnv=0x0, dest=0x229f094a1e0, qc=0x9b3f7ff9a0) at utility.c:738 #11 0x00007ff7a5c1c79b in PortalRunUtility (portal=portal at entry=0x229f0912c80, pstmt=pstmt at entry=0x229f0949e20, isTopLevel=isTopLevel at entry=true, setHoldSnapshot=setHoldSnapshot at entry=false, dest=0x229f094a1e0, qc=0x9b3f7ff9a0) at pquery.c:1153 #12 0x00007ff7a5c1c8f7 in PortalRunMulti (portal=portal at entry=0x229f0912c80, isTopLevel=isTopLevel at entry=true, setHoldSnapshot=setHoldSnapshot at entry=false, dest=dest at entry=0x229f094a1e0, altdest=altdest at entry=0x229f094a1e0, qc=qc at entry=0x9b3f7ff9a0) at pquery.c:1317 #13 0x00007ff7a5c1cf8f in PortalRun (portal=portal at entry=0x229f0912c80, count=count at entry=2147483647, isTopLevel=isTopLevel at entry=true, dest=dest at entry=0x229f094a1e0, altdest=altdest at entry=0x229f094a1e0, qc=qc at entry=0x9b3f7ff9a0) at pquery.c:788 #14 0x00007ff7a5c14b91 in exec_simple_query ( query_string=0x229f0948d60 "COPY foo.gf_active_play_area (objectid,ap_id,play_id,playname,basin_id,basin_name,description,playbasin_name,age_base_ma,age_base_name,age_top_ma,age_top_name,mapped,shape) FROM STDIN;") at postgres.c:1273 #15 0x00007ff7a5c19f77 in PostgresMain (dbname=0x229f08c5b10 "crashdb", username=0x229f0556778 "postgres") at postgres.c:4766 #16 0x00007ff7a5c10be9 in BackendMain (startup_data=, startup_data_len=) at backend_startup.c:124 #17 0x00007ff7a5b5f346 in SubPostmasterMain (argc=argc at entry=3, argv=argv at entry=0x229f0551980) at launch_backend.c:713 #18 0x00007ff7a5e3d32d in main (argc=3, argv=0x229f0551980) at main.c:214 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 08:45:13 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 15:45:13 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.bf38ddda0f1335befc59ec5b25a98500@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Hello. As I understand the situation the extraction did not go as expected and something broke geometry. So we should basically look into this direction. It's a bit odd that the data set does not crash at Paul's because as I said before it crashes all the clusters I tried at all the times. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 09:10:44 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 16:10:44 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.01a711e621490d990c6bc651b99ebd9c@osgeo.org> #6066: Pg19 + topology crash on regression test ----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: postgis | Version: master Resolution: | Keywords: ----------------------+--------------------------- Comment (by pramsey): Have confirmed that the crash behaviour starts with this Postgres commit https://github.com/postgres/postgres/commit/b7b27eb41a5cc0b45a1a9ce5c1cde5883d7bc358 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 11:51:40 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 18:51:40 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.f2c7001ed355fe44599efb639cb582e1@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by robe): * component: postgis => topology -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 14:16:17 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:16:17 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.872472de1744e69741f54c8dc69d9880@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): I confirm the crash with procedure in comment:3 and noticed that omitting the INSERT (ie: only calling the toTopoGeom select) does not trigger the crash. Dropping all triggers doesn't help instead. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 14:23:06 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:23:06 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.71735a82755060f406c1480155ce8142@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Another observation. By adding a second TopoGeometry column of type puntual: 1. You can get the crash ALSO when adding/inserting a POINT TopoGeometry 2. If you try to insert a POINT geometry into the LINEAL column you still get the WARNINGs but not the final crash (violation of check constraint prevents the crash) {{{ WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: TupleDesc 0x7fae0bf25590 (17671,-1) WARNING: resource was not closed: TupleDesc 0x7fae0bf103c8 (17681,-1) ERROR: new row for relation "t5118f" violates check constraint "check_topogeom_g" }}} I've to say this all sounds to me like a bug in PostgreSQL, not PostGIS. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 14:39:07 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:39:07 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-436-g0f7d3d562 Message-ID: <20260408213907.6862719F632@trac.osgeo.org> 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 0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d (commit) from 2c9277d3da0794f44dee60107d107cfd9939edeb (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 0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d Author: Paul Ramsey Date: Wed Apr 8 14:36:49 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that doesn't construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index cc3ea6800..e10d60bf9 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,103 +2206,157 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertices, compared to mindistance which can be between two vertices.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } diff --git a/regress/core/knn_recheck.sql b/regress/core/knn_recheck.sql index f08b7f0d6..45278b7fc 100644 --- a/regress/core/knn_recheck.sql +++ b/regress/core/knn_recheck.sql @@ -239,3 +239,31 @@ SET enable_seqscan = false; SELECT '#5782', l FROM t5782 ORDER BY g <-> 'POINT(18.006691126034692 69.04048768506776)'::geometry; DROP TABLE t5782; SET enable_seqscan to default; + +-- +-- https://trac.osgeo.org/postgis/ticket/6026 +-- +CREATE TABLE reproduce_6026 ( + id SERIAL PRIMARY KEY, + geometry GEOMETRY(POLYGON, 28992) +); +INSERT INTO reproduce_6026 (geometry) VALUES + (ST_GeomFromText('POLYGON ((133894.531 490000, 132700 490000, 132460 490000, 131703.958 489011.71, 131695 489000, 132880 489000, 132880 488416.725, 133206.605 488583.011, 134029.81 489022.36, 133917.695 490000, 133894.531 490000))', 28992)), + (ST_GeomFromText('POLYGON ((138000 492000, 141276.49 492000, 141050 492550, 140967.11 492751.305, 139951.651 495217.42, 139490.072 495217.42, 136358.892 495217.42, 135900 495217.42, 135301.1 495217.42, 135118.887 495296.573, 135115.873 495264.338, 135106.301 495164.456, 135098.485 495065.802, 135090.476 494967.014, 135085.764 494917.296, 135078.439 494866.459, 135070.381 494817.483, 135060.353 494767.172, 135036.351 494674.319, 135017.779 494615.505, 134991.438 494544.049, 134972.66 494501.055, 134948.148 494446.666, 134922.544 494398.914, 134872.859 494311.273, 134859.929 494292.444, 134843.402 494264.587, 134815.107 494200.454, 134770.855 494120.756, 134728.422 494053.048, 134932.74 493923.77, 133708.3 491825.92, 133917.695 490000, 134029.81 489022.36, 138000 492000))', 28992)), + (ST_GeomFromText('POLYGON ((131215.201 487105.005, 134029.81 486992.15, 134029.81 489022.36, 133206.605 488583.011, 132880 488416.725, 132198.685 488069.845, 131375.721 487651.916, 131199.012 487560.733, 131198.76 487560.603, 131215.201 487105.005))', 28992)), + (ST_GeomFromText('POLYGON ((134029.81 489022.36, 136889.1 488581.7, 138000 492000, 134029.81 489022.36))', 28992)), + (ST_GeomFromText('POLYGON ((133917.695 490000, 133708.3 491825.92, 133541.312 491951.805, 133460 491840, 132820 491000, 132210 490190, 132460 490000, 132700 490000, 133894.531 490000, 133917.695 490000))', 28992)); + +-- create index +CREATE INDEX reproduce_6026_x +ON reproduce_6026 USING GIST(geometry); +-- force index usage +SET enable_seqscan = OFF; +-- Reproduce error +SELECT '#6026', id + FROM reproduce_6026 + ORDER BY geometry <-> ST_SetSRID(ST_MakePoint(133718, 489222), 28992) + LIMIT 4; + +DROP TABLE reproduce_6026; + diff --git a/regress/core/knn_recheck_expected b/regress/core/knn_recheck_expected index 226f99ed7..051131700 100644 --- a/regress/core/knn_recheck_expected +++ b/regress/core/knn_recheck_expected @@ -107,3 +107,7 @@ #3418|0.5500000|0.5500000 #5782|A #5782|B +#6026|1 +#6026|2 +#6026|3 +#6026|4 ----------------------------------------------------------------------- Summary of changes: liblwgeom/measures.c | 176 +++++++++++++++++++++++++------------- regress/core/knn_recheck.sql | 28 ++++++ regress/core/knn_recheck_expected | 4 + 3 files changed, 147 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:39:18 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:39:18 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.0979fd2b0ac0707f82914464e57963e2@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d/git" 0f7d3d5/git]: {{{#!CommitTicketReference repository="git" revision="0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that doesn't construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 14:43:03 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:43:03 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-13-ge91db587b Message-ID: <20260408214303.92EA819F9EC@trac.osgeo.org> 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.6 has been updated via e91db587b9ec8dcb4cbea6faa48e2b92be100290 (commit) from b25865df6950e117a859324e9d570de4b2292df6 (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 e91db587b9ec8dcb4cbea6faa48e2b92be100290 Author: Paul Ramsey Date: Wed Apr 8 14:42:25 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index 5078062b0..7deb40571 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,7 @@ topogeometry corruption: - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) - +- #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.6.2 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index cc3ea6800..458e82978 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,106 +2206,161 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertices, compared to mindistance which can be between two vertices.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } + /** Compares incoming points and stores the points closest to each other or most far away from each other depending on * dl->mode (max or min) */ int ----------------------------------------------------------------------- Summary of changes: NEWS | 2 +- liblwgeom/measures.c | 177 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 117 insertions(+), 62 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:43:09 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:43:09 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.db151dfd206a24f88820ca1acf72bba0@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"e91db587b9ec8dcb4cbea6faa48e2b92be100290/git" e91db58/git]: {{{#!CommitTicketReference repository="git" revision="e91db587b9ec8dcb4cbea6faa48e2b92be100290" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 14:44:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:44:45 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-12-ge880eb837 Message-ID: <20260408214445.EC281138388@trac.osgeo.org> 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.5 has been updated via e880eb8371ee31ada8b11c0fa580b08f1d4dc806 (commit) from cb5334b7c736f9edc1e6e124d4688300111ab397 (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 e880eb8371ee31ada8b11c0fa580b08f1d4dc806 Author: Paul Ramsey Date: Wed Apr 8 14:44:37 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index 58e7e8bf4..a75a2f7c6 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.5.5 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index b96e7bf62..6e13442cc 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,103 +2206,157 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertices, compared to mindistance which can be between two vertices.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/measures.c | 176 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 116 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:44:47 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:44:47 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.1a4b0d5913dcd9267017a435259b837f@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"e880eb8371ee31ada8b11c0fa580b08f1d4dc806/git" e880eb8/git]: {{{#!CommitTicketReference repository="git" revision="e880eb8371ee31ada8b11c0fa580b08f1d4dc806" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 14:46:40 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:46:40 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-14-gabdf9e9b7 Message-ID: <20260408214640.79164138184@trac.osgeo.org> 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.4 has been updated via abdf9e9b713aee3741deb946330dbf2c802692db (commit) from 9441c6b61df7799408119c3f2c912740a80405d6 (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 abdf9e9b713aee3741deb946330dbf2c802692db Author: Paul Ramsey Date: Wed Apr 8 14:46:29 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index 941b52c53..7ead93205 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Proj 6.1+ required. and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.4.5 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index 613a217bf..d2f7b9783 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2206,103 +2206,157 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertexes, compared to mindistance which can be between two vertexes.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/measures.c | 176 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 116 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:46:41 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:46:41 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.08b5bc255d1b3eefdaaebb0380aca42f@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"abdf9e9b713aee3741deb946330dbf2c802692db/git" abdf9e9/git]: {{{#!CommitTicketReference repository="git" revision="abdf9e9b713aee3741deb946330dbf2c802692db" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 8 14:48:01 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 8 Apr 2026 14:48:01 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-12-gb1e96843c Message-ID: <20260408214801.A495F138288@trac.osgeo.org> 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.3 has been updated via b1e96843c5aebc7effb907fbe9ee3c815447a40f (commit) from 9abdb5153690679b44cced668ba32c9cba833dc5 (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 b1e96843c5aebc7effb907fbe9ee3c815447a40f Author: Paul Ramsey Date: Wed Apr 8 14:47:46 2026 -0700 Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 diff --git a/NEWS b/NEWS index afccd4faf..cb3aec833 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ PostGIS 3.3.10 and Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) PostGIS 3.3.9 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index 2fd217e90..2774b38c0 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2216,106 +2216,161 @@ End of New faster distance calculations Functions in common for Brute force and new calculation --------------------------------------------------------------------------------------------------------------*/ -/** -lw_dist2d_comp from p to line A->B -This one is now sending every occasion to lw_dist2d_pt_pt -Before it was handling occasions where r was between 0 and 1 internally -and just returning the distance without identifying the points. -To get this points it was necessary to change and it also showed to be about 10%faster. -*/ int -lw_dist2d_pt_seg(const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl) +lw_dist2d_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B, DISTPTS *dl) { - double r; - - LWDEBUG(2, "lw_dist2d_pt_seg called"); - - /*if start==end, then use pt distance */ - if ((A->x == B->x) && (A->y == B->y)) - { - LWDEBUG(2, "lw_dist2d_pt_seg found first and last segment points being the same"); - return lw_dist2d_pt_pt(p, A, dl); - } - + POINT2D P; + int is_vertical = (A->x == B->x); + int is_horizontal = (A->y == B->y); /* - * otherwise, we use comp.graphics.algorithms - * Frequently Asked Questions method + * If A == B, then use pt-pt distance + */ + if (is_vertical && is_horizontal) + return lw_dist2d_pt_pt(C, A, dl); + + /* + * We use comp.graphics.algorithms Frequently Asked Questions method + * + * Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). + * Let P be the point of perpendicular projection of C on AB. The parameter + * r, which indicates P's position along AB, is computed by the dot product + * of AC and AB divided by the square of the length of AB: + * + * (1) AC dot AB + * r = --------- + * ||AB||^2 + * + * The length of a line segment + * + * L = sqrt( (Bx-Ax)^2 + (By-Ay)^2 ) + * + * So (1) expands to: + * + * (Cx-Ax)(Bx-Ax) + (Cy-Ay)(By-Ay) + * r = ------------------------------- + * L^2 + * + * r has the following meaning: + * + * r=0 P = A + * r=1 P = B + * r<0 P is on the backward extension of AB + * r>1 P is on the forward extension of AB + * 01 P is on the forward extension of AB - * 0x - A->x) * (B->x - A->x) + (p->y - A->y) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + double dx = B->x - A->x; + double dy = B->y - A->y; + double L2 = (dx*dx) + (dy*dy); - LWDEBUGF(2, "lw_dist2d_pt_seg found r = %.15g", r); + double r = ((C->x - A->x) * dx + (C->y - A->y) * dy) / L2; - /*This is for finding the maxdistance. - the maxdistance have to be between two vertexes, compared to mindistance which can be between two vertexes.*/ + /* + * This is for finding the maxdistance. + * The maxdistance have to be between two vertices, + * compared to mindistance which can be between two vertices. + */ if (dl->mode == DIST_MAX) { if (r >= 0.5) - return lw_dist2d_pt_pt(p, A, dl); + return lw_dist2d_pt_pt(C, A, dl); else /* (r < 0.5) */ - return lw_dist2d_pt_pt(p, B, dl); + return lw_dist2d_pt_pt(C, B, dl); } - if (r < 0) /*If p projected on the line is outside point A*/ - return lw_dist2d_pt_pt(p, A, dl); - if (r >= 1) /*If p projected on the line is outside point B or on point B*/ - return lw_dist2d_pt_pt(p, B, dl); - - /*If the point p is on the segment this is a more robust way to find out that*/ - if ((((A->y - p->y) * (B->x - A->x) == (A->x - p->x) * (B->y - A->y))) && (dl->mode == DIST_MIN)) - { - lw_dist2d_distpts_set(dl, 0, p, p); - } - - /* - (2) - (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) - s = ----------------------------- - L^2 + * If projected point P is outside point A + */ + if (r < 0) + return lw_dist2d_pt_pt(C, A, dl); - Then the distance from C to P = |s|*L. - */ + /* + * If projected point P is is outside + * point B or on point B + */ + if (r >= 1) + return lw_dist2d_pt_pt(C, B, dl); - double s = ((A->y - p->y) * (B->x - A->x) - (A->x - p->x) * (B->y - A->y)) / - ((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y)); + /* + * If point C is on the segment AB then + * distance is zero and nearest point is C + */ + if ((A->y - C->y) * dx == (A->x - C->x) * dy) + { + lw_dist2d_distpts_set(dl, 0.0, C, C); + } - double dist = fabs(s) * sqrt(((B->x - A->x) * (B->x - A->x) + (B->y - A->y) * (B->y - A->y))); - if ( dist < dl->distance ) + /* + * The point P can then be found: + * + * Px = Ax + r(Bx-Ax) + * Py = Ay + r(By-Ay) + * + * And the distance from A to P = r*L. + */ + + /* + * If the projection of point C on the segment is + * between A and B then we find that "point on segment" + * and send it to lw_dist2d_pt_pt + */ + if (is_horizontal || is_vertical) + { + P.x = A->x + r * dx; + P.y = A->y + r * dy; + return lw_dist2d_pt_pt(C, &P, dl); + } + + /* + * + * Use another parameter s to indicate the location along PC, with the + * following meaning: + * s<0 C is left of AB + * s>0 C is right of AB + * s=0 C is on AB + * + * Compute s as follows: + * + * (Ay-Cy)(Bx-Ax)-(Ax-Cx)(By-Ay) + * s = ----------------------------- + * L^2 + * + * + * Then the distance from C to P = s*L. + */ + + /* + * Calculate distance without reference to the + * projected point P. + */ + double s = ((A->y - C->y) * dx - (A->x - C->x) * dy) / L2; + + double dist = fabs(s) * sqrt(L2); + // double dist = fabs(s) * hypot(dx, dy); + if (dist < dl->distance) { dl->distance = dist; { - POINT2D c; - c.x = A->x + r * (B->x - A->x); - c.y = A->y + r * (B->y - A->y); + P.x = A->x + r * dx; + P.y = A->y + r * dy; if (dl->twisted > 0) { - dl->p1 = *p; - dl->p2 = c; + dl->p1 = *C; + dl->p2 = P; } else { - dl->p1 = c; - dl->p2 = *p; + dl->p1 = P; + dl->p2 = *C; } } } - return LW_TRUE; } + /** Compares incoming points and stores the points closest to each other or most far away from each other depending on * dl->mode (max or min) */ int ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/measures.c | 177 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 117 insertions(+), 61 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 8 14:48:03 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:48:03 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.29e285b56b115a8179453dbffdd50666@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Comment (by Paul Ramsey ): In [changeset:"b1e96843c5aebc7effb907fbe9ee3c815447a40f/git" b1e9684/git]: {{{#!CommitTicketReference repository="git" revision="b1e96843c5aebc7effb907fbe9ee3c815447a40f" Clean up and add another special case to lw_dist2d_pt_seg() When the seg is vertical or horizontal, we construct the nearest points to avoid getting a difference between the more-exact distance calculation that does not construct and the naturally constructive process of building a bbox, which can result in a situation where the "real distance" between two objects can be less than the "box distance", which is simply not allowed. References #6026 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 14:48:14 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 21:48:14 -0000 Subject: [PostGIS] #6026: Distance operator <-> returns "tuple order" error In-Reply-To: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> References: <046.61c89b29de719ab748d312199cfaaacb@osgeo.org> Message-ID: <061.1f86b9e50478e4c62ff790367b6dd560@osgeo.org> #6026: Distance operator <-> returns "tuple order" error ----------------------+---------------------------------------------- Reporter: dirc | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: Component: postgis | Version: 3.5.x Resolution: fixed | Keywords: distance, operator, tuple, order ----------------------+---------------------------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 15:19:13 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 22:19:13 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.32eaa04ac656a980eff9c9e7a7e4fb73@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by pramsey): Pretty sure I see the issue, which I am surprised never showed up before? 20 years in? But the parser is returning a error location of 1131025 when the WKT input is only 1047553 bytes long. This rather screws up the logic in lwmessage_truncate, I think. I will have to see if I can generate this organically on smaller inputs. One task is just to make lwmessage_truncate more robust. Another is to explore why the error location is 10% too large. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 15:21:24 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 22:21:24 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.33d1e8b5207c026d03c9ea668dd82ced@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by pramsey): (The WKT is truly incorrect though, it is truncated, so something in your Oracle conversion process is trimming it, and your data load would have failed, had we not, er... crashed.) {{{ cat gf_active_play_area.sql | grep "15.46475600 46.64170500" }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 16:29:16 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 23:29:16 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.6acd4e7bfd53c7d2816cb9dc4d555213@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: strk Type: defect | Status: assigned Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): > I've to say this all sounds to me like a bug in PostgreSQL, not PostGIS. Yah sounds like it. We don't even have an C code behind toTopogeom, it's all plpgsql so can't see how we could have screwed that up. I'll see if I can create an example that doesn't involve postgis to trigger the bug and bounce it back to the PostgreSQL court if I can. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 8 16:29:29 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 08 Apr 2026 23:29:29 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.cf0a4b71083dcf15eb3036b0828e3dbf@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by robe): * owner: strk => robe * status: assigned => new -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 9 02:17:16 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 09:17:16 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.9a643bc50ba4297846fb6e0a2b0cfe61@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Well, toTopoGeom calls into C functions, so it's not purely plpgsql. Adding NOTICE prints in the C function (TopoGeo_AddPoint, which is the smallest) I see the warnings and the crash happen after `SPI_finish`: {{{ BEGIN NOTICE: Before SPI finish NOTICE: After SPI finish WARNING: resource was not closed: relation "face" WARNING: resource was not closed: relation "face_primary_key" WARNING: resource was not closed: TupleDesc 0x7f26697ec598 (17671,-1) WARNING: resource was not closed: TupleDesc 0x7f26697d63f0 (17681,-1) server closed the connection unexpectedly }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 9 02:18:23 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 09:18:23 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.95492305acc1b9fb0ab9b4a25a633346@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Also: skipping SPI completely avoids the crash, so this seems to be SPI related -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 9 08:35:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 15:35:21 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.7d1b2b20e08c8e0a20d1d3e0959f546b@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+--------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.6.2 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): For reference, link to message Sandro sent to hackers - https://www.postgresql.org/message-id/adeIhgpWq22E5kwW%40hst.kbt.io -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 9 09:03:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 16:03:21 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.90c341f792e2308a97817450fbad2b48@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+-------------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: PostGIS PostgreSQL Component: topology | Version: master Resolution: | Keywords: -----------------------+-------------------------------- Changes (by strk): * milestone: PostGIS 3.6.2 => PostGIS PostgreSQL -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 9 09:03:49 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 16:03:49 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.231cf6c1d9738a6e46c8fb1908f142eb@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Thanks a lot for the support, I will try to look into the trimming issue. So far, I can see that SDE.ST_ASTEXT does not truncate this geometry, so most likely this happens in ora2pg. Do you need any other help from me? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 09:45:00 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 09:45:00 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-437-gee5c80269 Message-ID: <20260409164500.D224D16E66A@trac.osgeo.org> 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 ee5c8026941e2920c2b1ca4f4edd6177b06864a2 (commit) from 0f7d3d5628d0cf598c27ffe69e6fb25e8d05fe5d (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 ee5c8026941e2920c2b1ca4f4edd6177b06864a2 Author: Sandro Santilli Date: Thu Apr 9 18:44:42 2026 +0200 Ignore build dir during spell checking diff --git a/.codespellrc b/.codespellrc index 82f0b40c0..5fea525d5 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,7 @@ [codespell] ignore-words = .codespell.ignore skip = + ./build/**, ./deps/**, ./extensions/*/sql/**, ./extensions/*/sql_bits/*.sql, ----------------------------------------------------------------------- Summary of changes: .codespellrc | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 9 11:02:56 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 11:02:56 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-438-g593e1f084 Message-ID: <20260409180256.5F23216F61C@trac.osgeo.org> 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 593e1f084ae381a2a32c8a8e33b4502ec3eb1c9e (commit) from ee5c8026941e2920c2b1ca4f4edd6177b06864a2 (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 593e1f084ae381a2a32c8a8e33b4502ec3eb1c9e Author: Sandro Santilli Date: Thu Apr 9 20:01:59 2026 +0200 Drop left-over debug lines from test diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql index f54145537..04b63f2e9 100644 --- a/topology/test/regress/topogeo_addlinestring.sql +++ b/topology/test/regress/topogeo_addlinestring.sql @@ -643,13 +643,11 @@ SELECT 't6064.1', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', )'); SELECT 't6064.check.intermediate', * FROM topology.ValidateTopology('t6064'); -set client_min_messages to DEBUG; SELECT 't6064.2', count(*) > 0 FROM topology.TopoGeo_addLinestring('t6064', 'LINESTRING( 17.42207545158653 69.11091383590062, 17.42207570266477 69.11091383235974, 17.622976580401076 69.12848944101118 )'); -set client_min_messages to WARNING; SELECT 't6064.check.final', * FROM topology.ValidateTopology('t6064'); SELECT NULL FROM topology.DropTopology ('t6064'); ----------------------------------------------------------------------- Summary of changes: topology/test/regress/topogeo_addlinestring.sql | 2 -- 1 file changed, 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 9 14:56:31 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 14:56:31 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-14-gbf475b549 Message-ID: <20260409215631.EF53B18048C@trac.osgeo.org> 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.6 has been updated via bf475b54959c3605055e783496f3d8474d696e9e (commit) from e91db587b9ec8dcb4cbea6faa48e2b92be100290 (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 bf475b54959c3605055e783496f3d8474d696e9e Author: Paul Ramsey Date: Thu Apr 9 14:55:38 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index 7deb40571..1d69eb34d 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,7 @@ topogeometry corruption: - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) +- #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.6.2 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..d6b0845c2 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 3656af4e9..ad0dad519 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -276,6 +276,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 66 ++++++++++++++++++++++++++---------------------- liblwgeom/lwin_wkt_lex.l | 6 ++--- liblwgeom/lwutil.c | 4 +++ 4 files changed, 43 insertions(+), 34 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 14:56:41 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 21:56:41 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.62060acb6b02a2be2e5c3064a446eaa0@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"bf475b54959c3605055e783496f3d8474d696e9e/git" bf475b54/git]: {{{#!CommitTicketReference repository="git" revision="bf475b54959c3605055e783496f3d8474d696e9e" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 14:57:49 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 14:57:49 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-13-g5c1ed575d Message-ID: <20260409215749.568B218058B@trac.osgeo.org> 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.5 has been updated via 5c1ed575d82b33355f2ed338e5c41c30e99d2f48 (commit) from e880eb8371ee31ada8b11c0fa580b08f1d4dc806 (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 5c1ed575d82b33355f2ed338e5c41c30e99d2f48 Author: Paul Ramsey Date: Thu Apr 9 14:57:33 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index a75a2f7c6..23a96792c 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. - #6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.5.5 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..d6b0845c2 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 3656af4e9..ad0dad519 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -276,6 +276,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 66 ++++++++++++++++++++++++++---------------------- liblwgeom/lwin_wkt_lex.l | 6 ++--- liblwgeom/lwutil.c | 4 +++ 4 files changed, 43 insertions(+), 34 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 14:57:50 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 21:57:50 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.08ec7cf25cae7d9ac006b5a887b54db1@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"5c1ed575d82b33355f2ed338e5c41c30e99d2f48/git" 5c1ed575/git]: {{{#!CommitTicketReference repository="git" revision="5c1ed575d82b33355f2ed338e5c41c30e99d2f48" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 14:59:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 14:59:16 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-15-ga94af5771 Message-ID: <20260409215916.DABD9180236@trac.osgeo.org> 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.4 has been updated via a94af577180ed222ec217a20c4330713b40936ce (commit) from abdf9e9b713aee3741deb946330dbf2c802692db (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 a94af577180ed222ec217a20c4330713b40936ce Author: Paul Ramsey Date: Thu Apr 9 14:59:02 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index 7ead93205..dce1d6bfe 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Proj 6.1+ required. - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.4.5 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..0ba962865 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, + 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, - 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, - 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, - 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, + 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,44 +678,42 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[53] = +static const YY_CHAR yy_meta[36] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 + 1, 1, 1, 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, - 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, - 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, - 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, - 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, - 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, - 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, - 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, - 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, - 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, + 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, + 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, + 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, + 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, + 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, + 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, + 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, + 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, + 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, + 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, - 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, - 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, - 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, - 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, - 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, - 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, - 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, - 342, 351, 347, 391, 391, 391 + 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, + 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, + 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, + 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, + 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, + 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, + 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, + 67, 54, 39, 221, 221, 221 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -734,110 +732,68 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[444] = +static const flex_int16_t yy_nxt[257] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, - 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, - 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, - 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, + 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, + 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, + 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, + 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, + 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, + 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, + 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, - 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, - 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, - 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, - 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, - 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, - 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, - 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, - 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, - 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, - 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, + 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, + 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, + 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, + 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, + 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, + 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, + 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, + 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, - 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, - 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, - 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, - 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, - 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, - 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, - 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, - 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, - 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, - 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, - - 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, - 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, - 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, - 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, - 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, - 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, - 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, - 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, - 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, + 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, + 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; -static const flex_int16_t yy_chk[444] = +static const flex_int16_t yy_chk[257] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, - 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, - 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, + 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, + 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, + 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, + 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, + 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, + 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, + 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, - 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, - 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, - 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, - 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, - 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, - 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, - 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, - 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, - 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, - 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, - - 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, - 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, - 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, - 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, - 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, - 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, - 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, - 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, - 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, - 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, - - 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, - 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, - 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, - 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, - 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, - 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, - 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, - 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, - 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, + 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, + 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, + 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, + 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, + 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, + 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, + 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, + 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, + 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -903,10 +859,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 906 "lwin_wkt_lex.c" +#line 862 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 909 "lwin_wkt_lex.c" +#line 865 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1124,7 +1080,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1127 "lwin_wkt_lex.c" +#line 1083 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1179,29 +1135,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1172,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1261,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1296,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1302 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2245,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 5f63acfa8..f8a39aa19 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -270,6 +270,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 260 ++++++++++++++++++++--------------------------- liblwgeom/lwin_wkt_lex.l | 6 +- liblwgeom/lwutil.c | 4 + 4 files changed, 118 insertions(+), 153 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 14:59:18 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 21:59:18 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.f3074f5a9b02688dfa3c9c6f0a39006d@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"a94af577180ed222ec217a20c4330713b40936ce/git" a94af57/git]: {{{#!CommitTicketReference repository="git" revision="a94af577180ed222ec217a20c4330713b40936ce" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 15:00:33 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 15:00:33 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-13-g1e9706654 Message-ID: <20260409220033.47144180428@trac.osgeo.org> 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.3 has been updated via 1e9706654e856e794701d7573e448986944956e5 (commit) from b1e96843c5aebc7effb907fbe9ee3c815447a40f (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 1e9706654e856e794701d7573e448986944956e5 Author: Paul Ramsey Date: Thu Apr 9 15:00:17 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index cb3aec833..bf3150120 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ PostGIS 3.3.10 - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.3.9 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..d6b0845c2 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 5f63acfa8..f8a39aa19 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -270,6 +270,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 66 ++++++++++++++++++++++++++---------------------- liblwgeom/lwin_wkt_lex.l | 6 ++--- liblwgeom/lwutil.c | 4 +++ 4 files changed, 43 insertions(+), 34 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 15:00:35 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:00:35 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.21ab9e777361ad9e8ae4e654c099195f@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"1e9706654e856e794701d7573e448986944956e5/git" 1e97066/git]: {{{#!CommitTicketReference repository="git" revision="1e9706654e856e794701d7573e448986944956e5" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 15:01:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 15:01:41 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-7-gd491e6a68 Message-ID: <20260409220141.A4A9918043A@trac.osgeo.org> 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.2 has been updated via d491e6a68b19b3a049f72fb5e3b6b9f007e04295 (commit) from 458f750305a0986d7aac6ab47d4a6fa576d153eb (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 d491e6a68b19b3a049f72fb5e3b6b9f007e04295 Author: Paul Ramsey Date: Thu Apr 9 15:01:30 2026 -0700 WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 diff --git a/NEWS b/NEWS index 5c95631e9..556664e47 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Proj 4.9+ required. - #6054, Remove priv escalation scenario. Reported by Daniel Bakker - GH-850 Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) - #6060, fully quality calls to helper functions (Paul Ramsey) + - #6061, WKT parser produces incorrect error locations (Paul Ramsey) PostGIS 3.2.9 diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..0ba962865 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, + 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, - 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, - 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, - 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, + 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,44 +678,42 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[53] = +static const YY_CHAR yy_meta[36] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1 + 1, 1, 1, 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, - 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, - 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, - 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, - 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, - 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, - 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, - 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, - 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, - 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, + 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, + 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, + 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, + 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, + 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, + 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, + 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, + 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, + 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, + 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, - 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, - 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, - 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, - 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, - 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, - 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, - 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, - 342, 351, 347, 391, 391, 391 + 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, + 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, + 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, + 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, + 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, + 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, + 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, + 67, 54, 39, 221, 221, 221 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -734,110 +732,68 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[444] = +static const flex_int16_t yy_nxt[257] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, - 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, - 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, - 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, - 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, + 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, + 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, + 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, + 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, + 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, + 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, + 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, - 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, - 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, - 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, - 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, - 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, - 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, - 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, - 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, - 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, - 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, + 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, + 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, + 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, + 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, + 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, + 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, + 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, + 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, - 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, - 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, - 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, - 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, - 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, - 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, - 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, - 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, - 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, - 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, - - 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, - 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, - 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, - 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, - 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, - 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, - 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, - 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, - 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, + 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, + 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; -static const flex_int16_t yy_chk[444] = +static const flex_int16_t yy_chk[257] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, - 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, - 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, - 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, + 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, + 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, + 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, + 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, + 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, + 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, + 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, - 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, - 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, - 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, - 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, - 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, - 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, - 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, - 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, - 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, - 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, - - 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, - 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, - 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, - 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, - 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, - 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, - 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, - 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, - 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, - 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, - - 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, - 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, - 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, - 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, - 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, - 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, - 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, - 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, - 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, + 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, + 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, + 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, + 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, + 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, + 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, + 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, + 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, + 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, + 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176 + 176, 176, 176, 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -903,10 +859,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 906 "lwin_wkt_lex.c" +#line 862 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 909 "lwin_wkt_lex.c" +#line 865 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1124,7 +1080,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1127 "lwin_wkt_lex.c" +#line 1083 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1179,29 +1135,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1172,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1261,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1296,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1302 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2245,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..f2a4d963c 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 5f63acfa8..f8a39aa19 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -270,6 +270,10 @@ char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int char *output; char *outstart; + int strsz = strlen(str); + if (endpos > strsz) + endpos = strsz; + /* Allocate space for new string */ output = lwalloc(maxlength + 4); output[0] = '\0'; ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + liblwgeom/lwin_wkt_lex.c | 260 ++++++++++++++++++++--------------------------- liblwgeom/lwin_wkt_lex.l | 6 +- liblwgeom/lwutil.c | 4 + 4 files changed, 118 insertions(+), 153 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 15:01:43 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:01:43 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.8c1209dcfeaf9041400903db207b2619@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"d491e6a68b19b3a049f72fb5e3b6b9f007e04295/git" d491e6a6/git]: {{{#!CommitTicketReference repository="git" revision="d491e6a68b19b3a049f72fb5e3b6b9f007e04295" WKT parser produces incorrect error locations. In extreme cases causes occasional crashes. References #6061 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 15:04:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 15:04:16 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-439-g6f3355d3a Message-ID: <20260409220416.A65721800BF@trac.osgeo.org> 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 6f3355d3a1046c5f1af80e499cbad6f4f438dd9d (commit) from 593e1f084ae381a2a32c8a8e33b4502ec3eb1c9e (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 6f3355d3a1046c5f1af80e499cbad6f4f438dd9d Author: Paul Ramsey Date: Thu Apr 9 15:03:52 2026 -0700 Rework the WKT parser position counter, which was dramatically over counting the parse position, resulting in bad memory accesses for long enough inputs with errors near the ends. References #6061 diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 011efab70..b9081db9c 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -2296,7 +2296,7 @@ extern char* hexbytes_from_bytes(const uint8_t *bytes, size_t size); /* * WKT detailed parsing support */ -extern int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parse_flags); +extern int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, const char *wktstr, int parse_flags); void lwgeom_parser_result_init(LWGEOM_PARSER_RESULT *parser_result); void lwgeom_parser_result_free(LWGEOM_PARSER_RESULT *parser_result); @@ -2307,7 +2307,7 @@ extern void *lwrealloc(void *mem, size_t size); extern void lwfree(void *mem); /* Utilities */ -extern char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int truncdirection); +extern char *lwmessage_truncate(const char *str, int errpos, int maxlength); /* * TWKB functions diff --git a/liblwgeom/lwin_wkt.c b/liblwgeom/lwin_wkt.c index c9a1bde25..174388d84 100644 --- a/liblwgeom/lwin_wkt.c +++ b/liblwgeom/lwin_wkt.c @@ -941,7 +941,7 @@ LWGEOM *lwgeom_from_wkt(const char *wkt, const char check) { LWGEOM_PARSER_RESULT r; - if( LW_FAILURE == lwgeom_parse_wkt(&r, (char*)wkt, check) ) + if( LW_FAILURE == lwgeom_parse_wkt(&r, wkt, check) ) { lwerror("%s", r.message); return NULL; diff --git a/liblwgeom/lwin_wkt.h b/liblwgeom/lwin_wkt.h index b0165a573..11369e12e 100644 --- a/liblwgeom/lwin_wkt.h +++ b/liblwgeom/lwin_wkt.h @@ -48,7 +48,7 @@ extern const char *parser_error_messages[]; /* * Prototypes for the lexer */ -extern void wkt_lexer_init(char *str); +extern void wkt_lexer_init(const char *str); extern void wkt_lexer_close(void); extern int wkt_yylex_destroy(void); diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index f194112fa..bea50e86e 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -1179,29 +1179,35 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 62 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 2: /* rule 2 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 3); +(yy_c_buf_p) = yy_cp = yy_bp + 3; +YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 69 "lwin_wkt_lex.l" +#line 68 "lwin_wkt_lex.l" { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } YY_BREAK case 3: YY_RULE_SETUP -#line 76 "lwin_wkt_lex.l" +#line 74 "lwin_wkt_lex.l" { LWDEBUG(5,"SRID"); wkt_yylval.integervalue = wkt_lexer_read_srid(wkt_yytext); @@ -1210,87 +1216,87 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 82 "lwin_wkt_lex.l" +#line 80 "lwin_wkt_lex.l" { return COLLECTION_TOK; } YY_BREAK case 5: YY_RULE_SETUP -#line 83 "lwin_wkt_lex.l" +#line 81 "lwin_wkt_lex.l" { return MSURFACE_TOK; } YY_BREAK case 6: YY_RULE_SETUP -#line 84 "lwin_wkt_lex.l" +#line 82 "lwin_wkt_lex.l" { return MPOLYGON_TOK; } YY_BREAK case 7: YY_RULE_SETUP -#line 85 "lwin_wkt_lex.l" +#line 83 "lwin_wkt_lex.l" { return MCURVE_TOK; } YY_BREAK case 8: YY_RULE_SETUP -#line 86 "lwin_wkt_lex.l" +#line 84 "lwin_wkt_lex.l" { return MLINESTRING_TOK; } YY_BREAK case 9: YY_RULE_SETUP -#line 87 "lwin_wkt_lex.l" +#line 85 "lwin_wkt_lex.l" { return MPOINT_TOK; } YY_BREAK case 10: YY_RULE_SETUP -#line 88 "lwin_wkt_lex.l" +#line 86 "lwin_wkt_lex.l" { return CURVEPOLYGON_TOK; } YY_BREAK case 11: YY_RULE_SETUP -#line 89 "lwin_wkt_lex.l" +#line 87 "lwin_wkt_lex.l" { return POLYGON_TOK; } YY_BREAK case 12: YY_RULE_SETUP -#line 90 "lwin_wkt_lex.l" +#line 88 "lwin_wkt_lex.l" { return COMPOUNDCURVE_TOK; } YY_BREAK case 13: YY_RULE_SETUP -#line 91 "lwin_wkt_lex.l" +#line 89 "lwin_wkt_lex.l" { return CIRCULARSTRING_TOK; } YY_BREAK case 14: YY_RULE_SETUP -#line 92 "lwin_wkt_lex.l" +#line 90 "lwin_wkt_lex.l" { return LINESTRING_TOK; } YY_BREAK case 15: YY_RULE_SETUP -#line 93 "lwin_wkt_lex.l" +#line 91 "lwin_wkt_lex.l" { return POLYHEDRALSURFACE_TOK; } YY_BREAK case 16: YY_RULE_SETUP -#line 94 "lwin_wkt_lex.l" +#line 92 "lwin_wkt_lex.l" { return TRIANGLE_TOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 95 "lwin_wkt_lex.l" +#line 93 "lwin_wkt_lex.l" { return TIN_TOK; } YY_BREAK case 18: YY_RULE_SETUP -#line 96 "lwin_wkt_lex.l" +#line 94 "lwin_wkt_lex.l" { return POINT_TOK; } YY_BREAK case 19: YY_RULE_SETUP -#line 97 "lwin_wkt_lex.l" +#line 95 "lwin_wkt_lex.l" { return EMPTY_TOK; } YY_BREAK case 20: YY_RULE_SETUP -#line 99 "lwin_wkt_lex.l" +#line 97 "lwin_wkt_lex.l" { LWDEBUG(5,"DIMENSIONALITY"); wkt_yylval.stringvalue = wkt_yytext; @@ -1299,33 +1305,33 @@ YY_RULE_SETUP YY_BREAK case 21: YY_RULE_SETUP -#line 105 "lwin_wkt_lex.l" +#line 103 "lwin_wkt_lex.l" { LWDEBUG(5,"LBRACKET"); return LBRACKET_TOK; } YY_BREAK case 22: YY_RULE_SETUP -#line 106 "lwin_wkt_lex.l" +#line 104 "lwin_wkt_lex.l" { LWDEBUG(5,"RBRACKET"); return RBRACKET_TOK; } YY_BREAK case 23: YY_RULE_SETUP -#line 107 "lwin_wkt_lex.l" +#line 105 "lwin_wkt_lex.l" { LWDEBUG(5,"COMMA"); return COMMA_TOK; } YY_BREAK case 24: YY_RULE_SETUP -#line 108 "lwin_wkt_lex.l" +#line 106 "lwin_wkt_lex.l" { LWDEBUG(5,"SEMICOLON"); return SEMICOLON_TOK; } YY_BREAK case 25: /* rule 25 can match eol */ YY_RULE_SETUP -#line 110 "lwin_wkt_lex.l" +#line 108 "lwin_wkt_lex.l" { /* ignore whitespace */ LWDEBUG(5,"WHITESPACE"); } YY_BREAK case 26: YY_RULE_SETUP -#line 112 "lwin_wkt_lex.l" +#line 110 "lwin_wkt_lex.l" { /* Error out and stop parsing on unknown/unexpected characters */ LWDEBUG(5,"UNKNOWN"); wkt_lexer_unknown(); @@ -1334,10 +1340,10 @@ YY_RULE_SETUP YY_BREAK case 27: YY_RULE_SETUP -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1340 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2283,7 +2289,7 @@ static int yy_flex_strlen (const char * s ) #define YYTABLES_NAME "yytables" -#line 118 "lwin_wkt_lex.l" +#line 116 "lwin_wkt_lex.l" void *wkt_yyalloc (yy_size_t size ) @@ -2304,7 +2310,7 @@ void wkt_yyfree (void * ptr ) /* * Set up the lexer! */ -void wkt_lexer_init(char *src) +void wkt_lexer_init(const char *src) { yy_init_globals(); wkt_yy_buf_state = wkt_yy_scan_string(src); diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index d301a2259..10b444d12 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -59,17 +59,15 @@ static void wkt_lexer_unknown() %% --?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)[ \,\)\t\n\r] { +-?(([0-9]+\.?)|([0-9]*\.?[0-9]+)([eE][-+]?[0-9]+)?)/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE"); wkt_yylval.doublevalue = atof(wkt_yytext); - yyless(wkt_yyleng-1); return DOUBLE_TOK; } -([Nn][Aa][Nn])[ \,\)\t\n\r] { +([Nn][Aa][Nn])/[ \,\)\t\n\r] { LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; - yyless(wkt_yyleng-1); return DOUBLE_TOK; } @@ -135,7 +133,7 @@ void wkt_yyfree (void * ptr ) /* * Set up the lexer! */ -void wkt_lexer_init(char *src) +void wkt_lexer_init(const char *src) { yy_init_globals(); wkt_yy_buf_state = wkt_yy_scan_string(src); diff --git a/liblwgeom/lwin_wkt_parse.c b/liblwgeom/lwin_wkt_parse.c index b921af6e6..142e4f2d8 100644 --- a/liblwgeom/lwin_wkt_parse.c +++ b/liblwgeom/lwin_wkt_parse.c @@ -123,7 +123,7 @@ void wkt_yyerror(__attribute__((__unused__)) const char *str) * (eg, from within other functions in lwin_wkt.c) or from a threaded program. * Note that parser_result.wkinput picks up a reference to wktstr. */ -int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parser_check_flags) +int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, const char *wktstr, int parser_check_flags) { int parse_rv = 0; @@ -474,7 +474,7 @@ typedef int yy_state_fast_t; #define YY_ASSERT(E) ((void) (0 && (E))) -#if 1 +#if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -539,7 +539,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif -#endif /* 1 */ +#endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ @@ -668,27 +668,27 @@ static const yytype_int8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 217, 217, 219, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 240, - 242, 244, 246, 250, 252, 256, 258, 260, 262, 266, - 268, 270, 272, 274, 276, 280, 282, 284, 286, 290, - 292, 294, 296, 300, 302, 304, 306, 310, 312, 316, - 318, 322, 324, 326, 328, 332, 334, 338, 341, 343, - 345, 347, 351, 353, 357, 358, 359, 360, 363, 365, - 369, 371, 375, 378, 381, 383, 385, 387, 391, 393, - 395, 397, 399, 401, 405, 407, 409, 411, 415, 417, - 419, 421, 423, 425, 427, 429, 433, 435, 437, 439, - 443, 445, 449, 451, 453, 455, 459, 461, 463, 465, - 469, 471, 475, 477, 481, 483, 485, 487, 491, 495, - 497, 499, 501, 505, 507, 511, 513, 515, 519, 521, - 523, 525, 529, 531, 535, 537, 539 + 0, 216, 216, 218, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 239, + 241, 243, 245, 249, 251, 255, 257, 259, 261, 265, + 267, 269, 271, 273, 275, 279, 281, 283, 285, 289, + 291, 293, 295, 299, 301, 303, 305, 309, 311, 315, + 317, 321, 323, 325, 327, 331, 333, 337, 340, 342, + 344, 346, 350, 352, 356, 357, 358, 359, 362, 364, + 368, 370, 374, 377, 380, 382, 384, 386, 390, 392, + 394, 396, 398, 400, 404, 406, 408, 410, 414, 416, + 418, 420, 422, 424, 426, 428, 432, 434, 436, 438, + 442, 444, 448, 450, 452, 454, 458, 460, 462, 464, + 468, 470, 474, 476, 480, 482, 484, 486, 490, 494, + 496, 498, 500, 504, 506, 510, 512, 514, 518, 520, + 522, 524, 528, 530, 534, 536, 538 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) -#if 1 +#if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; @@ -1227,278 +1227,10 @@ int yydebug; #endif -/* Context of a parse error. */ -typedef struct -{ - yy_state_t *yyssp; - yysymbol_kind_t yytoken; - YYLTYPE *yylloc; -} yypcontext_t; - -/* Put in YYARG at most YYARGN of the expected tokens given the - current YYCTX, and return the number of tokens stored in YYARG. If - YYARG is null, return the number of expected tokens (guaranteed to - be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. - Return 0 if there are more than YYARGN expected tokens, yet fill - YYARG up to YYARGN. */ -static int -yypcontext_expected_tokens (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - int yyn = yypact[+*yyctx->yyssp]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (!yyarg) - ++yycount; - else if (yycount == yyargn) - return 0; - else - yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); - } - } - if (yyarg && yycount == 0 && 0 < yyargn) - yyarg[0] = YYSYMBOL_YYEMPTY; - return yycount; -} -#ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else -/* Return the length of YYSTR. */ -static YYPTRDIFF_T -yystrlen (const char *yystr) -{ - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -#endif - -#ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -#endif - -#ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYPTRDIFF_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (yyres) - return yystpcpy (yyres, yystr) - yyres; - else - return yystrlen (yystr); -} -#endif - - -static int -yy_syntax_error_arguments (const yypcontext_t *yyctx, - yysymbol_kind_t yyarg[], int yyargn) -{ - /* Actual size of YYARG. */ - int yycount = 0; - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yyctx->yytoken != YYSYMBOL_YYEMPTY) - { - int yyn; - if (yyarg) - yyarg[yycount] = yyctx->yytoken; - ++yycount; - yyn = yypcontext_expected_tokens (yyctx, - yyarg ? yyarg + 1 : yyarg, yyargn - 1); - if (yyn == YYENOMEM) - return YYENOMEM; - else - yycount += yyn; - } - return yycount; -} - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - const yypcontext_t *yyctx) -{ - enum { YYARGS_MAX = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - yysymbol_kind_t yyarg[YYARGS_MAX]; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* Actual size of YYARG. */ - int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); - if (yycount == YYENOMEM) - return YYENOMEM; - - switch (yycount) - { -#define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -#undef YYCASE_ - } - - /* Compute error message size. Don't count the "%s"s, but reserve - room for the terminator. */ - yysize = yystrlen (yyformat) - 2 * yycount + 1; - { - int yyi; - for (yyi = 0; yyi < yycount; ++yyi) - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return YYENOMEM; - } - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return -1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); - yyformat += 2; - } - else - { - ++yyp; - ++yyformat; - } - } - return 0; -} - - /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ @@ -1517,225 +1249,225 @@ yydestruct (const char *yymsg, switch (yykind) { case YYSYMBOL_geometry_no_srid: /* geometry_no_srid */ -#line 194 "lwin_wkt_parse.y" +#line 193 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1523 "lwin_wkt_parse.c" +#line 1255 "lwin_wkt_parse.c" break; case YYSYMBOL_geometrycollection: /* geometrycollection */ -#line 195 "lwin_wkt_parse.y" +#line 194 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1529 "lwin_wkt_parse.c" +#line 1261 "lwin_wkt_parse.c" break; case YYSYMBOL_geometry_list: /* geometry_list */ -#line 196 "lwin_wkt_parse.y" +#line 195 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1535 "lwin_wkt_parse.c" +#line 1267 "lwin_wkt_parse.c" break; case YYSYMBOL_multisurface: /* multisurface */ -#line 203 "lwin_wkt_parse.y" +#line 202 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1541 "lwin_wkt_parse.c" +#line 1273 "lwin_wkt_parse.c" break; case YYSYMBOL_surface_list: /* surface_list */ -#line 181 "lwin_wkt_parse.y" +#line 180 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1547 "lwin_wkt_parse.c" +#line 1279 "lwin_wkt_parse.c" break; case YYSYMBOL_tin: /* tin */ -#line 210 "lwin_wkt_parse.y" +#line 209 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1553 "lwin_wkt_parse.c" +#line 1285 "lwin_wkt_parse.c" break; case YYSYMBOL_polyhedralsurface: /* polyhedralsurface */ -#line 209 "lwin_wkt_parse.y" +#line 208 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1559 "lwin_wkt_parse.c" +#line 1291 "lwin_wkt_parse.c" break; case YYSYMBOL_multipolygon: /* multipolygon */ -#line 202 "lwin_wkt_parse.y" +#line 201 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1565 "lwin_wkt_parse.c" +#line 1297 "lwin_wkt_parse.c" break; case YYSYMBOL_polygon_list: /* polygon_list */ -#line 182 "lwin_wkt_parse.y" +#line 181 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1571 "lwin_wkt_parse.c" +#line 1303 "lwin_wkt_parse.c" break; case YYSYMBOL_patch_list: /* patch_list */ -#line 183 "lwin_wkt_parse.y" +#line 182 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1577 "lwin_wkt_parse.c" +#line 1309 "lwin_wkt_parse.c" break; case YYSYMBOL_polygon: /* polygon */ -#line 206 "lwin_wkt_parse.y" +#line 205 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1583 "lwin_wkt_parse.c" +#line 1315 "lwin_wkt_parse.c" break; case YYSYMBOL_polygon_untagged: /* polygon_untagged */ -#line 208 "lwin_wkt_parse.y" +#line 207 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1589 "lwin_wkt_parse.c" +#line 1321 "lwin_wkt_parse.c" break; case YYSYMBOL_patch: /* patch */ -#line 207 "lwin_wkt_parse.y" +#line 206 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1595 "lwin_wkt_parse.c" +#line 1327 "lwin_wkt_parse.c" break; case YYSYMBOL_curvepolygon: /* curvepolygon */ -#line 192 "lwin_wkt_parse.y" +#line 191 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1601 "lwin_wkt_parse.c" +#line 1333 "lwin_wkt_parse.c" break; case YYSYMBOL_curvering_list: /* curvering_list */ -#line 179 "lwin_wkt_parse.y" +#line 178 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1607 "lwin_wkt_parse.c" +#line 1339 "lwin_wkt_parse.c" break; case YYSYMBOL_curvering: /* curvering */ -#line 193 "lwin_wkt_parse.y" +#line 192 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1613 "lwin_wkt_parse.c" +#line 1345 "lwin_wkt_parse.c" break; case YYSYMBOL_patchring_list: /* patchring_list */ -#line 189 "lwin_wkt_parse.y" +#line 188 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1619 "lwin_wkt_parse.c" +#line 1351 "lwin_wkt_parse.c" break; case YYSYMBOL_ring_list: /* ring_list */ -#line 188 "lwin_wkt_parse.y" +#line 187 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1625 "lwin_wkt_parse.c" +#line 1357 "lwin_wkt_parse.c" break; case YYSYMBOL_patchring: /* patchring */ -#line 178 "lwin_wkt_parse.y" +#line 177 "lwin_wkt_parse.y" { ptarray_free(((*yyvaluep).ptarrayvalue)); } -#line 1631 "lwin_wkt_parse.c" +#line 1363 "lwin_wkt_parse.c" break; case YYSYMBOL_ring: /* ring */ -#line 177 "lwin_wkt_parse.y" +#line 176 "lwin_wkt_parse.y" { ptarray_free(((*yyvaluep).ptarrayvalue)); } -#line 1637 "lwin_wkt_parse.c" +#line 1369 "lwin_wkt_parse.c" break; case YYSYMBOL_compoundcurve: /* compoundcurve */ -#line 191 "lwin_wkt_parse.y" +#line 190 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1643 "lwin_wkt_parse.c" +#line 1375 "lwin_wkt_parse.c" break; case YYSYMBOL_compound_list: /* compound_list */ -#line 187 "lwin_wkt_parse.y" +#line 186 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1649 "lwin_wkt_parse.c" +#line 1381 "lwin_wkt_parse.c" break; case YYSYMBOL_multicurve: /* multicurve */ -#line 199 "lwin_wkt_parse.y" +#line 198 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1655 "lwin_wkt_parse.c" +#line 1387 "lwin_wkt_parse.c" break; case YYSYMBOL_curve_list: /* curve_list */ -#line 186 "lwin_wkt_parse.y" +#line 185 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1661 "lwin_wkt_parse.c" +#line 1393 "lwin_wkt_parse.c" break; case YYSYMBOL_multilinestring: /* multilinestring */ -#line 200 "lwin_wkt_parse.y" +#line 199 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1667 "lwin_wkt_parse.c" +#line 1399 "lwin_wkt_parse.c" break; case YYSYMBOL_linestring_list: /* linestring_list */ -#line 185 "lwin_wkt_parse.y" +#line 184 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1673 "lwin_wkt_parse.c" +#line 1405 "lwin_wkt_parse.c" break; case YYSYMBOL_circularstring: /* circularstring */ -#line 190 "lwin_wkt_parse.y" +#line 189 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1679 "lwin_wkt_parse.c" +#line 1411 "lwin_wkt_parse.c" break; case YYSYMBOL_linestring: /* linestring */ -#line 197 "lwin_wkt_parse.y" +#line 196 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1685 "lwin_wkt_parse.c" +#line 1417 "lwin_wkt_parse.c" break; case YYSYMBOL_linestring_untagged: /* linestring_untagged */ -#line 198 "lwin_wkt_parse.y" +#line 197 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1691 "lwin_wkt_parse.c" +#line 1423 "lwin_wkt_parse.c" break; case YYSYMBOL_triangle_list: /* triangle_list */ -#line 180 "lwin_wkt_parse.y" +#line 179 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1697 "lwin_wkt_parse.c" +#line 1429 "lwin_wkt_parse.c" break; case YYSYMBOL_triangle: /* triangle */ -#line 211 "lwin_wkt_parse.y" +#line 210 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1703 "lwin_wkt_parse.c" +#line 1435 "lwin_wkt_parse.c" break; case YYSYMBOL_triangle_untagged: /* triangle_untagged */ -#line 212 "lwin_wkt_parse.y" +#line 211 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1709 "lwin_wkt_parse.c" +#line 1441 "lwin_wkt_parse.c" break; case YYSYMBOL_multipoint: /* multipoint */ -#line 201 "lwin_wkt_parse.y" +#line 200 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1715 "lwin_wkt_parse.c" +#line 1447 "lwin_wkt_parse.c" break; case YYSYMBOL_point_list: /* point_list */ -#line 184 "lwin_wkt_parse.y" +#line 183 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1721 "lwin_wkt_parse.c" +#line 1453 "lwin_wkt_parse.c" break; case YYSYMBOL_point_untagged: /* point_untagged */ -#line 205 "lwin_wkt_parse.y" +#line 204 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1727 "lwin_wkt_parse.c" +#line 1459 "lwin_wkt_parse.c" break; case YYSYMBOL_point: /* point */ -#line 204 "lwin_wkt_parse.y" +#line 203 "lwin_wkt_parse.y" { lwgeom_free(((*yyvaluep).geometryvalue)); } -#line 1733 "lwin_wkt_parse.c" +#line 1465 "lwin_wkt_parse.c" break; case YYSYMBOL_ptarray: /* ptarray */ -#line 176 "lwin_wkt_parse.y" +#line 175 "lwin_wkt_parse.y" { ptarray_free(((*yyvaluep).ptarrayvalue)); } -#line 1739 "lwin_wkt_parse.c" +#line 1471 "lwin_wkt_parse.c" break; default: @@ -1807,10 +1539,7 @@ yyparse (void) /* The locations where the error started and ended. */ YYLTYPE yyerror_range[3]; - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; + #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) @@ -2031,817 +1760,817 @@ yyreduce: switch (yyn) { case 2: /* geometry: geometry_no_srid */ -#line 218 "lwin_wkt_parse.y" +#line 217 "lwin_wkt_parse.y" { wkt_parser_geometry_new((yyvsp[0].geometryvalue), SRID_UNKNOWN); WKT_ERROR(); } -#line 2037 "lwin_wkt_parse.c" +#line 1766 "lwin_wkt_parse.c" break; case 3: /* geometry: SRID_TOK SEMICOLON_TOK geometry_no_srid */ -#line 220 "lwin_wkt_parse.y" +#line 219 "lwin_wkt_parse.y" { wkt_parser_geometry_new((yyvsp[0].geometryvalue), (yyvsp[-2].integervalue)); WKT_ERROR(); } -#line 2043 "lwin_wkt_parse.c" +#line 1772 "lwin_wkt_parse.c" break; case 4: /* geometry_no_srid: point */ -#line 223 "lwin_wkt_parse.y" +#line 222 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2049 "lwin_wkt_parse.c" +#line 1778 "lwin_wkt_parse.c" break; case 5: /* geometry_no_srid: linestring */ -#line 224 "lwin_wkt_parse.y" +#line 223 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2055 "lwin_wkt_parse.c" +#line 1784 "lwin_wkt_parse.c" break; case 6: /* geometry_no_srid: circularstring */ -#line 225 "lwin_wkt_parse.y" +#line 224 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2061 "lwin_wkt_parse.c" +#line 1790 "lwin_wkt_parse.c" break; case 7: /* geometry_no_srid: compoundcurve */ -#line 226 "lwin_wkt_parse.y" +#line 225 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2067 "lwin_wkt_parse.c" +#line 1796 "lwin_wkt_parse.c" break; case 8: /* geometry_no_srid: polygon */ -#line 227 "lwin_wkt_parse.y" +#line 226 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2073 "lwin_wkt_parse.c" +#line 1802 "lwin_wkt_parse.c" break; case 9: /* geometry_no_srid: curvepolygon */ -#line 228 "lwin_wkt_parse.y" +#line 227 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2079 "lwin_wkt_parse.c" +#line 1808 "lwin_wkt_parse.c" break; case 10: /* geometry_no_srid: multipoint */ -#line 229 "lwin_wkt_parse.y" +#line 228 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2085 "lwin_wkt_parse.c" +#line 1814 "lwin_wkt_parse.c" break; case 11: /* geometry_no_srid: multilinestring */ -#line 230 "lwin_wkt_parse.y" +#line 229 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2091 "lwin_wkt_parse.c" +#line 1820 "lwin_wkt_parse.c" break; case 12: /* geometry_no_srid: multipolygon */ -#line 231 "lwin_wkt_parse.y" +#line 230 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2097 "lwin_wkt_parse.c" +#line 1826 "lwin_wkt_parse.c" break; case 13: /* geometry_no_srid: multisurface */ -#line 232 "lwin_wkt_parse.y" +#line 231 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2103 "lwin_wkt_parse.c" +#line 1832 "lwin_wkt_parse.c" break; case 14: /* geometry_no_srid: multicurve */ -#line 233 "lwin_wkt_parse.y" +#line 232 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2109 "lwin_wkt_parse.c" +#line 1838 "lwin_wkt_parse.c" break; case 15: /* geometry_no_srid: tin */ -#line 234 "lwin_wkt_parse.y" +#line 233 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2115 "lwin_wkt_parse.c" +#line 1844 "lwin_wkt_parse.c" break; case 16: /* geometry_no_srid: polyhedralsurface */ -#line 235 "lwin_wkt_parse.y" +#line 234 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2121 "lwin_wkt_parse.c" +#line 1850 "lwin_wkt_parse.c" break; case 17: /* geometry_no_srid: triangle */ -#line 236 "lwin_wkt_parse.y" +#line 235 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2127 "lwin_wkt_parse.c" +#line 1856 "lwin_wkt_parse.c" break; case 18: /* geometry_no_srid: geometrycollection */ -#line 237 "lwin_wkt_parse.y" +#line 236 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2133 "lwin_wkt_parse.c" +#line 1862 "lwin_wkt_parse.c" break; case 19: /* geometrycollection: COLLECTION_TOK LBRACKET_TOK geometry_list RBRACKET_TOK */ -#line 241 "lwin_wkt_parse.y" +#line 240 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2139 "lwin_wkt_parse.c" +#line 1868 "lwin_wkt_parse.c" break; case 20: /* geometrycollection: COLLECTION_TOK DIMENSIONALITY_TOK LBRACKET_TOK geometry_list RBRACKET_TOK */ -#line 243 "lwin_wkt_parse.y" +#line 242 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2145 "lwin_wkt_parse.c" +#line 1874 "lwin_wkt_parse.c" break; case 21: /* geometrycollection: COLLECTION_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 245 "lwin_wkt_parse.y" +#line 244 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2151 "lwin_wkt_parse.c" +#line 1880 "lwin_wkt_parse.c" break; case 22: /* geometrycollection: COLLECTION_TOK EMPTY_TOK */ -#line 247 "lwin_wkt_parse.y" +#line 246 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, NULL); WKT_ERROR(); } -#line 2157 "lwin_wkt_parse.c" +#line 1886 "lwin_wkt_parse.c" break; case 23: /* geometry_list: geometry_list COMMA_TOK geometry_no_srid */ -#line 251 "lwin_wkt_parse.y" +#line 250 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2163 "lwin_wkt_parse.c" +#line 1892 "lwin_wkt_parse.c" break; case 24: /* geometry_list: geometry_no_srid */ -#line 253 "lwin_wkt_parse.y" +#line 252 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2169 "lwin_wkt_parse.c" +#line 1898 "lwin_wkt_parse.c" break; case 25: /* multisurface: MSURFACE_TOK LBRACKET_TOK surface_list RBRACKET_TOK */ -#line 257 "lwin_wkt_parse.y" +#line 256 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2175 "lwin_wkt_parse.c" +#line 1904 "lwin_wkt_parse.c" break; case 26: /* multisurface: MSURFACE_TOK DIMENSIONALITY_TOK LBRACKET_TOK surface_list RBRACKET_TOK */ -#line 259 "lwin_wkt_parse.y" +#line 258 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2181 "lwin_wkt_parse.c" +#line 1910 "lwin_wkt_parse.c" break; case 27: /* multisurface: MSURFACE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 261 "lwin_wkt_parse.y" +#line 260 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2187 "lwin_wkt_parse.c" +#line 1916 "lwin_wkt_parse.c" break; case 28: /* multisurface: MSURFACE_TOK EMPTY_TOK */ -#line 263 "lwin_wkt_parse.y" +#line 262 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, NULL); WKT_ERROR(); } -#line 2193 "lwin_wkt_parse.c" +#line 1922 "lwin_wkt_parse.c" break; case 29: /* surface_list: surface_list COMMA_TOK polygon */ -#line 267 "lwin_wkt_parse.y" +#line 266 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2199 "lwin_wkt_parse.c" +#line 1928 "lwin_wkt_parse.c" break; case 30: /* surface_list: surface_list COMMA_TOK curvepolygon */ -#line 269 "lwin_wkt_parse.y" +#line 268 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2205 "lwin_wkt_parse.c" +#line 1934 "lwin_wkt_parse.c" break; case 31: /* surface_list: surface_list COMMA_TOK polygon_untagged */ -#line 271 "lwin_wkt_parse.y" +#line 270 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2211 "lwin_wkt_parse.c" +#line 1940 "lwin_wkt_parse.c" break; case 32: /* surface_list: polygon */ -#line 273 "lwin_wkt_parse.y" +#line 272 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2217 "lwin_wkt_parse.c" +#line 1946 "lwin_wkt_parse.c" break; case 33: /* surface_list: curvepolygon */ -#line 275 "lwin_wkt_parse.y" +#line 274 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2223 "lwin_wkt_parse.c" +#line 1952 "lwin_wkt_parse.c" break; case 34: /* surface_list: polygon_untagged */ -#line 277 "lwin_wkt_parse.y" +#line 276 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2229 "lwin_wkt_parse.c" +#line 1958 "lwin_wkt_parse.c" break; case 35: /* tin: TIN_TOK LBRACKET_TOK triangle_list RBRACKET_TOK */ -#line 281 "lwin_wkt_parse.y" +#line 280 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2235 "lwin_wkt_parse.c" +#line 1964 "lwin_wkt_parse.c" break; case 36: /* tin: TIN_TOK DIMENSIONALITY_TOK LBRACKET_TOK triangle_list RBRACKET_TOK */ -#line 283 "lwin_wkt_parse.y" +#line 282 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2241 "lwin_wkt_parse.c" +#line 1970 "lwin_wkt_parse.c" break; case 37: /* tin: TIN_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 285 "lwin_wkt_parse.y" +#line 284 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2247 "lwin_wkt_parse.c" +#line 1976 "lwin_wkt_parse.c" break; case 38: /* tin: TIN_TOK EMPTY_TOK */ -#line 287 "lwin_wkt_parse.y" +#line 286 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, NULL); WKT_ERROR(); } -#line 2253 "lwin_wkt_parse.c" +#line 1982 "lwin_wkt_parse.c" break; case 39: /* polyhedralsurface: POLYHEDRALSURFACE_TOK LBRACKET_TOK patch_list RBRACKET_TOK */ -#line 291 "lwin_wkt_parse.y" +#line 290 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2259 "lwin_wkt_parse.c" +#line 1988 "lwin_wkt_parse.c" break; case 40: /* polyhedralsurface: POLYHEDRALSURFACE_TOK DIMENSIONALITY_TOK LBRACKET_TOK patch_list RBRACKET_TOK */ -#line 293 "lwin_wkt_parse.y" +#line 292 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2265 "lwin_wkt_parse.c" +#line 1994 "lwin_wkt_parse.c" break; case 41: /* polyhedralsurface: POLYHEDRALSURFACE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 295 "lwin_wkt_parse.y" +#line 294 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2271 "lwin_wkt_parse.c" +#line 2000 "lwin_wkt_parse.c" break; case 42: /* polyhedralsurface: POLYHEDRALSURFACE_TOK EMPTY_TOK */ -#line 297 "lwin_wkt_parse.y" +#line 296 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, NULL); WKT_ERROR(); } -#line 2277 "lwin_wkt_parse.c" +#line 2006 "lwin_wkt_parse.c" break; case 43: /* multipolygon: MPOLYGON_TOK LBRACKET_TOK polygon_list RBRACKET_TOK */ -#line 301 "lwin_wkt_parse.y" +#line 300 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2283 "lwin_wkt_parse.c" +#line 2012 "lwin_wkt_parse.c" break; case 44: /* multipolygon: MPOLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK polygon_list RBRACKET_TOK */ -#line 303 "lwin_wkt_parse.y" +#line 302 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2289 "lwin_wkt_parse.c" +#line 2018 "lwin_wkt_parse.c" break; case 45: /* multipolygon: MPOLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 305 "lwin_wkt_parse.y" +#line 304 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2295 "lwin_wkt_parse.c" +#line 2024 "lwin_wkt_parse.c" break; case 46: /* multipolygon: MPOLYGON_TOK EMPTY_TOK */ -#line 307 "lwin_wkt_parse.y" +#line 306 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, NULL); WKT_ERROR(); } -#line 2301 "lwin_wkt_parse.c" +#line 2030 "lwin_wkt_parse.c" break; case 47: /* polygon_list: polygon_list COMMA_TOK polygon_untagged */ -#line 311 "lwin_wkt_parse.y" +#line 310 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2307 "lwin_wkt_parse.c" +#line 2036 "lwin_wkt_parse.c" break; case 48: /* polygon_list: polygon_untagged */ -#line 313 "lwin_wkt_parse.y" +#line 312 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2313 "lwin_wkt_parse.c" +#line 2042 "lwin_wkt_parse.c" break; case 49: /* patch_list: patch_list COMMA_TOK patch */ -#line 317 "lwin_wkt_parse.y" +#line 316 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2319 "lwin_wkt_parse.c" +#line 2048 "lwin_wkt_parse.c" break; case 50: /* patch_list: patch */ -#line 319 "lwin_wkt_parse.y" +#line 318 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2325 "lwin_wkt_parse.c" +#line 2054 "lwin_wkt_parse.c" break; case 51: /* polygon: POLYGON_TOK LBRACKET_TOK ring_list RBRACKET_TOK */ -#line 323 "lwin_wkt_parse.y" +#line 322 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2331 "lwin_wkt_parse.c" +#line 2060 "lwin_wkt_parse.c" break; case 52: /* polygon: POLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK ring_list RBRACKET_TOK */ -#line 325 "lwin_wkt_parse.y" +#line 324 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2337 "lwin_wkt_parse.c" +#line 2066 "lwin_wkt_parse.c" break; case 53: /* polygon: POLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 327 "lwin_wkt_parse.y" +#line 326 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2343 "lwin_wkt_parse.c" +#line 2072 "lwin_wkt_parse.c" break; case 54: /* polygon: POLYGON_TOK EMPTY_TOK */ -#line 329 "lwin_wkt_parse.y" +#line 328 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); } -#line 2349 "lwin_wkt_parse.c" +#line 2078 "lwin_wkt_parse.c" break; case 55: /* polygon_untagged: LBRACKET_TOK ring_list RBRACKET_TOK */ -#line 333 "lwin_wkt_parse.y" +#line 332 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); } -#line 2355 "lwin_wkt_parse.c" +#line 2084 "lwin_wkt_parse.c" break; case 56: /* polygon_untagged: EMPTY_TOK */ -#line 335 "lwin_wkt_parse.y" +#line 334 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); } -#line 2361 "lwin_wkt_parse.c" +#line 2090 "lwin_wkt_parse.c" break; case 57: /* patch: LBRACKET_TOK patchring_list RBRACKET_TOK */ -#line 338 "lwin_wkt_parse.y" +#line 337 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); } -#line 2367 "lwin_wkt_parse.c" +#line 2096 "lwin_wkt_parse.c" break; case 58: /* curvepolygon: CURVEPOLYGON_TOK LBRACKET_TOK curvering_list RBRACKET_TOK */ -#line 342 "lwin_wkt_parse.y" +#line 341 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2373 "lwin_wkt_parse.c" +#line 2102 "lwin_wkt_parse.c" break; case 59: /* curvepolygon: CURVEPOLYGON_TOK DIMENSIONALITY_TOK LBRACKET_TOK curvering_list RBRACKET_TOK */ -#line 344 "lwin_wkt_parse.y" +#line 343 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2379 "lwin_wkt_parse.c" +#line 2108 "lwin_wkt_parse.c" break; case 60: /* curvepolygon: CURVEPOLYGON_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 346 "lwin_wkt_parse.y" +#line 345 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2385 "lwin_wkt_parse.c" +#line 2114 "lwin_wkt_parse.c" break; case 61: /* curvepolygon: CURVEPOLYGON_TOK EMPTY_TOK */ -#line 348 "lwin_wkt_parse.y" +#line 347 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, NULL); WKT_ERROR(); } -#line 2391 "lwin_wkt_parse.c" +#line 2120 "lwin_wkt_parse.c" break; case 62: /* curvering_list: curvering_list COMMA_TOK curvering */ -#line 352 "lwin_wkt_parse.y" +#line 351 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2397 "lwin_wkt_parse.c" +#line 2126 "lwin_wkt_parse.c" break; case 63: /* curvering_list: curvering */ -#line 354 "lwin_wkt_parse.y" +#line 353 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_curvepolygon_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2403 "lwin_wkt_parse.c" +#line 2132 "lwin_wkt_parse.c" break; case 64: /* curvering: linestring_untagged */ -#line 357 "lwin_wkt_parse.y" +#line 356 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2409 "lwin_wkt_parse.c" +#line 2138 "lwin_wkt_parse.c" break; case 65: /* curvering: linestring */ -#line 358 "lwin_wkt_parse.y" +#line 357 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2415 "lwin_wkt_parse.c" +#line 2144 "lwin_wkt_parse.c" break; case 66: /* curvering: compoundcurve */ -#line 359 "lwin_wkt_parse.y" +#line 358 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2421 "lwin_wkt_parse.c" +#line 2150 "lwin_wkt_parse.c" break; case 67: /* curvering: circularstring */ -#line 360 "lwin_wkt_parse.y" +#line 359 "lwin_wkt_parse.y" { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); } -#line 2427 "lwin_wkt_parse.c" +#line 2156 "lwin_wkt_parse.c" break; case 68: /* patchring_list: patchring_list COMMA_TOK patchring */ -#line 364 "lwin_wkt_parse.y" +#line 363 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); } -#line 2433 "lwin_wkt_parse.c" +#line 2162 "lwin_wkt_parse.c" break; case 69: /* patchring_list: patchring */ -#line 366 "lwin_wkt_parse.y" +#line 365 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); } -#line 2439 "lwin_wkt_parse.c" +#line 2168 "lwin_wkt_parse.c" break; case 70: /* ring_list: ring_list COMMA_TOK ring */ -#line 370 "lwin_wkt_parse.y" +#line 369 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); } -#line 2445 "lwin_wkt_parse.c" +#line 2174 "lwin_wkt_parse.c" break; case 71: /* ring_list: ring */ -#line 372 "lwin_wkt_parse.y" +#line 371 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); } -#line 2451 "lwin_wkt_parse.c" +#line 2180 "lwin_wkt_parse.c" break; case 72: /* patchring: LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 375 "lwin_wkt_parse.y" +#line 374 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); } -#line 2457 "lwin_wkt_parse.c" +#line 2186 "lwin_wkt_parse.c" break; case 73: /* ring: LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 378 "lwin_wkt_parse.y" +#line 377 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); } -#line 2463 "lwin_wkt_parse.c" +#line 2192 "lwin_wkt_parse.c" break; case 74: /* compoundcurve: COMPOUNDCURVE_TOK LBRACKET_TOK compound_list RBRACKET_TOK */ -#line 382 "lwin_wkt_parse.y" +#line 381 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2469 "lwin_wkt_parse.c" +#line 2198 "lwin_wkt_parse.c" break; case 75: /* compoundcurve: COMPOUNDCURVE_TOK DIMENSIONALITY_TOK LBRACKET_TOK compound_list RBRACKET_TOK */ -#line 384 "lwin_wkt_parse.y" +#line 383 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2475 "lwin_wkt_parse.c" +#line 2204 "lwin_wkt_parse.c" break; case 76: /* compoundcurve: COMPOUNDCURVE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 386 "lwin_wkt_parse.y" +#line 385 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2481 "lwin_wkt_parse.c" +#line 2210 "lwin_wkt_parse.c" break; case 77: /* compoundcurve: COMPOUNDCURVE_TOK EMPTY_TOK */ -#line 388 "lwin_wkt_parse.y" +#line 387 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_finalize(NULL, NULL); WKT_ERROR(); } -#line 2487 "lwin_wkt_parse.c" +#line 2216 "lwin_wkt_parse.c" break; case 78: /* compound_list: compound_list COMMA_TOK circularstring */ -#line 392 "lwin_wkt_parse.y" +#line 391 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2493 "lwin_wkt_parse.c" +#line 2222 "lwin_wkt_parse.c" break; case 79: /* compound_list: compound_list COMMA_TOK linestring */ -#line 394 "lwin_wkt_parse.y" +#line 393 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2499 "lwin_wkt_parse.c" +#line 2228 "lwin_wkt_parse.c" break; case 80: /* compound_list: compound_list COMMA_TOK linestring_untagged */ -#line 396 "lwin_wkt_parse.y" +#line 395 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2505 "lwin_wkt_parse.c" +#line 2234 "lwin_wkt_parse.c" break; case 81: /* compound_list: circularstring */ -#line 398 "lwin_wkt_parse.y" +#line 397 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2511 "lwin_wkt_parse.c" +#line 2240 "lwin_wkt_parse.c" break; case 82: /* compound_list: linestring */ -#line 400 "lwin_wkt_parse.y" +#line 399 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2517 "lwin_wkt_parse.c" +#line 2246 "lwin_wkt_parse.c" break; case 83: /* compound_list: linestring_untagged */ -#line 402 "lwin_wkt_parse.y" +#line 401 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2523 "lwin_wkt_parse.c" +#line 2252 "lwin_wkt_parse.c" break; case 84: /* multicurve: MCURVE_TOK LBRACKET_TOK curve_list RBRACKET_TOK */ -#line 406 "lwin_wkt_parse.y" +#line 405 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2529 "lwin_wkt_parse.c" +#line 2258 "lwin_wkt_parse.c" break; case 85: /* multicurve: MCURVE_TOK DIMENSIONALITY_TOK LBRACKET_TOK curve_list RBRACKET_TOK */ -#line 408 "lwin_wkt_parse.y" +#line 407 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2535 "lwin_wkt_parse.c" +#line 2264 "lwin_wkt_parse.c" break; case 86: /* multicurve: MCURVE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 410 "lwin_wkt_parse.y" +#line 409 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2541 "lwin_wkt_parse.c" +#line 2270 "lwin_wkt_parse.c" break; case 87: /* multicurve: MCURVE_TOK EMPTY_TOK */ -#line 412 "lwin_wkt_parse.y" +#line 411 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, NULL); WKT_ERROR(); } -#line 2547 "lwin_wkt_parse.c" +#line 2276 "lwin_wkt_parse.c" break; case 88: /* curve_list: curve_list COMMA_TOK circularstring */ -#line 416 "lwin_wkt_parse.y" +#line 415 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2553 "lwin_wkt_parse.c" +#line 2282 "lwin_wkt_parse.c" break; case 89: /* curve_list: curve_list COMMA_TOK compoundcurve */ -#line 418 "lwin_wkt_parse.y" +#line 417 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2559 "lwin_wkt_parse.c" +#line 2288 "lwin_wkt_parse.c" break; case 90: /* curve_list: curve_list COMMA_TOK linestring */ -#line 420 "lwin_wkt_parse.y" +#line 419 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2565 "lwin_wkt_parse.c" +#line 2294 "lwin_wkt_parse.c" break; case 91: /* curve_list: curve_list COMMA_TOK linestring_untagged */ -#line 422 "lwin_wkt_parse.y" +#line 421 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2571 "lwin_wkt_parse.c" +#line 2300 "lwin_wkt_parse.c" break; case 92: /* curve_list: circularstring */ -#line 424 "lwin_wkt_parse.y" +#line 423 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2577 "lwin_wkt_parse.c" +#line 2306 "lwin_wkt_parse.c" break; case 93: /* curve_list: compoundcurve */ -#line 426 "lwin_wkt_parse.y" +#line 425 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2583 "lwin_wkt_parse.c" +#line 2312 "lwin_wkt_parse.c" break; case 94: /* curve_list: linestring */ -#line 428 "lwin_wkt_parse.y" +#line 427 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2589 "lwin_wkt_parse.c" +#line 2318 "lwin_wkt_parse.c" break; case 95: /* curve_list: linestring_untagged */ -#line 430 "lwin_wkt_parse.y" +#line 429 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2595 "lwin_wkt_parse.c" +#line 2324 "lwin_wkt_parse.c" break; case 96: /* multilinestring: MLINESTRING_TOK LBRACKET_TOK linestring_list RBRACKET_TOK */ -#line 434 "lwin_wkt_parse.y" +#line 433 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2601 "lwin_wkt_parse.c" +#line 2330 "lwin_wkt_parse.c" break; case 97: /* multilinestring: MLINESTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK linestring_list RBRACKET_TOK */ -#line 436 "lwin_wkt_parse.y" +#line 435 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2607 "lwin_wkt_parse.c" +#line 2336 "lwin_wkt_parse.c" break; case 98: /* multilinestring: MLINESTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 438 "lwin_wkt_parse.y" +#line 437 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2613 "lwin_wkt_parse.c" +#line 2342 "lwin_wkt_parse.c" break; case 99: /* multilinestring: MLINESTRING_TOK EMPTY_TOK */ -#line 440 "lwin_wkt_parse.y" +#line 439 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, NULL); WKT_ERROR(); } -#line 2619 "lwin_wkt_parse.c" +#line 2348 "lwin_wkt_parse.c" break; case 100: /* linestring_list: linestring_list COMMA_TOK linestring_untagged */ -#line 444 "lwin_wkt_parse.y" +#line 443 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2625 "lwin_wkt_parse.c" +#line 2354 "lwin_wkt_parse.c" break; case 101: /* linestring_list: linestring_untagged */ -#line 446 "lwin_wkt_parse.y" +#line 445 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2631 "lwin_wkt_parse.c" +#line 2360 "lwin_wkt_parse.c" break; case 102: /* circularstring: CIRCULARSTRING_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 450 "lwin_wkt_parse.y" +#line 449 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2637 "lwin_wkt_parse.c" +#line 2366 "lwin_wkt_parse.c" break; case 103: /* circularstring: CIRCULARSTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 452 "lwin_wkt_parse.y" +#line 451 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2643 "lwin_wkt_parse.c" +#line 2372 "lwin_wkt_parse.c" break; case 104: /* circularstring: CIRCULARSTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 454 "lwin_wkt_parse.y" +#line 453 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2649 "lwin_wkt_parse.c" +#line 2378 "lwin_wkt_parse.c" break; case 105: /* circularstring: CIRCULARSTRING_TOK EMPTY_TOK */ -#line 456 "lwin_wkt_parse.y" +#line 455 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, NULL); WKT_ERROR(); } -#line 2655 "lwin_wkt_parse.c" +#line 2384 "lwin_wkt_parse.c" break; case 106: /* linestring: LINESTRING_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 460 "lwin_wkt_parse.y" +#line 459 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2661 "lwin_wkt_parse.c" +#line 2390 "lwin_wkt_parse.c" break; case 107: /* linestring: LINESTRING_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 462 "lwin_wkt_parse.y" +#line 461 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2667 "lwin_wkt_parse.c" +#line 2396 "lwin_wkt_parse.c" break; case 108: /* linestring: LINESTRING_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 464 "lwin_wkt_parse.y" +#line 463 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2673 "lwin_wkt_parse.c" +#line 2402 "lwin_wkt_parse.c" break; case 109: /* linestring: LINESTRING_TOK EMPTY_TOK */ -#line 466 "lwin_wkt_parse.y" +#line 465 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); } -#line 2679 "lwin_wkt_parse.c" +#line 2408 "lwin_wkt_parse.c" break; case 110: /* linestring_untagged: LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 470 "lwin_wkt_parse.y" +#line 469 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2685 "lwin_wkt_parse.c" +#line 2414 "lwin_wkt_parse.c" break; case 111: /* linestring_untagged: EMPTY_TOK */ -#line 472 "lwin_wkt_parse.y" +#line 471 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); } -#line 2691 "lwin_wkt_parse.c" +#line 2420 "lwin_wkt_parse.c" break; case 112: /* triangle_list: triangle_list COMMA_TOK triangle_untagged */ -#line 476 "lwin_wkt_parse.y" +#line 475 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2697 "lwin_wkt_parse.c" +#line 2426 "lwin_wkt_parse.c" break; case 113: /* triangle_list: triangle_untagged */ -#line 478 "lwin_wkt_parse.y" +#line 477 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2703 "lwin_wkt_parse.c" +#line 2432 "lwin_wkt_parse.c" break; case 114: /* triangle: TRIANGLE_TOK LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */ -#line 482 "lwin_wkt_parse.y" +#line 481 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2709 "lwin_wkt_parse.c" +#line 2438 "lwin_wkt_parse.c" break; case 115: /* triangle: TRIANGLE_TOK DIMENSIONALITY_TOK LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */ -#line 484 "lwin_wkt_parse.y" +#line 483 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), (yyvsp[-5].stringvalue)); WKT_ERROR(); } -#line 2715 "lwin_wkt_parse.c" +#line 2444 "lwin_wkt_parse.c" break; case 116: /* triangle: TRIANGLE_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 486 "lwin_wkt_parse.y" +#line 485 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2721 "lwin_wkt_parse.c" +#line 2450 "lwin_wkt_parse.c" break; case 117: /* triangle: TRIANGLE_TOK EMPTY_TOK */ -#line 488 "lwin_wkt_parse.y" +#line 487 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, NULL); WKT_ERROR(); } -#line 2727 "lwin_wkt_parse.c" +#line 2456 "lwin_wkt_parse.c" break; case 118: /* triangle_untagged: LBRACKET_TOK LBRACKET_TOK ptarray RBRACKET_TOK RBRACKET_TOK */ -#line 492 "lwin_wkt_parse.y" +#line 491 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2733 "lwin_wkt_parse.c" +#line 2462 "lwin_wkt_parse.c" break; case 119: /* multipoint: MPOINT_TOK LBRACKET_TOK point_list RBRACKET_TOK */ -#line 496 "lwin_wkt_parse.y" +#line 495 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); } -#line 2739 "lwin_wkt_parse.c" +#line 2468 "lwin_wkt_parse.c" break; case 120: /* multipoint: MPOINT_TOK DIMENSIONALITY_TOK LBRACKET_TOK point_list RBRACKET_TOK */ -#line 498 "lwin_wkt_parse.y" +#line 497 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2745 "lwin_wkt_parse.c" +#line 2474 "lwin_wkt_parse.c" break; case 121: /* multipoint: MPOINT_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 500 "lwin_wkt_parse.y" +#line 499 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2751 "lwin_wkt_parse.c" +#line 2480 "lwin_wkt_parse.c" break; case 122: /* multipoint: MPOINT_TOK EMPTY_TOK */ -#line 502 "lwin_wkt_parse.y" +#line 501 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, NULL); WKT_ERROR(); } -#line 2757 "lwin_wkt_parse.c" +#line 2486 "lwin_wkt_parse.c" break; case 123: /* point_list: point_list COMMA_TOK point_untagged */ -#line 506 "lwin_wkt_parse.y" +#line 505 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2763 "lwin_wkt_parse.c" +#line 2492 "lwin_wkt_parse.c" break; case 124: /* point_list: point_untagged */ -#line 508 "lwin_wkt_parse.y" +#line 507 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); } -#line 2769 "lwin_wkt_parse.c" +#line 2498 "lwin_wkt_parse.c" break; case 125: /* point_untagged: coordinate */ -#line 512 "lwin_wkt_parse.y" +#line 511 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)),NULL); WKT_ERROR(); } -#line 2775 "lwin_wkt_parse.c" +#line 2504 "lwin_wkt_parse.c" break; case 126: /* point_untagged: LBRACKET_TOK coordinate RBRACKET_TOK */ -#line 514 "lwin_wkt_parse.y" +#line 513 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[-1].coordinatevalue)),NULL); WKT_ERROR(); } -#line 2781 "lwin_wkt_parse.c" +#line 2510 "lwin_wkt_parse.c" break; case 127: /* point_untagged: EMPTY_TOK */ -#line 516 "lwin_wkt_parse.y" +#line 515 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(NULL, NULL); WKT_ERROR(); } -#line 2787 "lwin_wkt_parse.c" +#line 2516 "lwin_wkt_parse.c" break; case 128: /* point: POINT_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 520 "lwin_wkt_parse.y" +#line 519 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); } -#line 2793 "lwin_wkt_parse.c" +#line 2522 "lwin_wkt_parse.c" break; case 129: /* point: POINT_TOK DIMENSIONALITY_TOK LBRACKET_TOK ptarray RBRACKET_TOK */ -#line 522 "lwin_wkt_parse.y" +#line 521 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); } -#line 2799 "lwin_wkt_parse.c" +#line 2528 "lwin_wkt_parse.c" break; case 130: /* point: POINT_TOK DIMENSIONALITY_TOK EMPTY_TOK */ -#line 524 "lwin_wkt_parse.y" +#line 523 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); } -#line 2805 "lwin_wkt_parse.c" +#line 2534 "lwin_wkt_parse.c" break; case 131: /* point: POINT_TOK EMPTY_TOK */ -#line 526 "lwin_wkt_parse.y" +#line 525 "lwin_wkt_parse.y" { (yyval.geometryvalue) = wkt_parser_point_new(NULL,NULL); WKT_ERROR(); } -#line 2811 "lwin_wkt_parse.c" +#line 2540 "lwin_wkt_parse.c" break; case 132: /* ptarray: ptarray COMMA_TOK coordinate */ -#line 530 "lwin_wkt_parse.y" +#line 529 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = wkt_parser_ptarray_add_coord((yyvsp[-2].ptarrayvalue), (yyvsp[0].coordinatevalue)); WKT_ERROR(); } -#line 2817 "lwin_wkt_parse.c" +#line 2546 "lwin_wkt_parse.c" break; case 133: /* ptarray: coordinate */ -#line 532 "lwin_wkt_parse.y" +#line 531 "lwin_wkt_parse.y" { (yyval.ptarrayvalue) = wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)); WKT_ERROR(); } -#line 2823 "lwin_wkt_parse.c" +#line 2552 "lwin_wkt_parse.c" break; case 134: /* coordinate: DOUBLE_TOK DOUBLE_TOK */ -#line 536 "lwin_wkt_parse.y" +#line 535 "lwin_wkt_parse.y" { (yyval.coordinatevalue) = wkt_parser_coord_2((yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); } -#line 2829 "lwin_wkt_parse.c" +#line 2558 "lwin_wkt_parse.c" break; case 135: /* coordinate: DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK */ -#line 538 "lwin_wkt_parse.y" +#line 537 "lwin_wkt_parse.y" { (yyval.coordinatevalue) = wkt_parser_coord_3((yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); } -#line 2835 "lwin_wkt_parse.c" +#line 2564 "lwin_wkt_parse.c" break; case 136: /* coordinate: DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK DOUBLE_TOK */ -#line 540 "lwin_wkt_parse.y" +#line 539 "lwin_wkt_parse.y" { (yyval.coordinatevalue) = wkt_parser_coord_4((yyvsp[-3].doublevalue), (yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); } -#line 2841 "lwin_wkt_parse.c" +#line 2570 "lwin_wkt_parse.c" break; -#line 2845 "lwin_wkt_parse.c" +#line 2574 "lwin_wkt_parse.c" default: break; } @@ -2889,37 +2618,7 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; - { - yypcontext_t yyctx - = {yyssp, yytoken, &yylloc}; - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == -1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (yymsg) - { - yysyntax_error_status - = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); - yymsgp = yymsg; - } - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = YYENOMEM; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == YYENOMEM) - YYNOMEM; - } + yyerror (YY_("syntax error")); } yyerror_range[1] = yylloc; @@ -3065,11 +2764,10 @@ yyreturnlab: if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); + return yyresult; } -#line 542 "lwin_wkt_parse.y" +#line 541 "lwin_wkt_parse.y" diff --git a/liblwgeom/lwin_wkt_parse.h b/liblwgeom/lwin_wkt_parse.h index f9365f3c2..12e27aee2 100644 --- a/liblwgeom/lwin_wkt_parse.h +++ b/liblwgeom/lwin_wkt_parse.h @@ -85,7 +85,7 @@ extern int wkt_yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { -#line 112 "lwin_wkt_parse.y" +#line 111 "lwin_wkt_parse.y" int integervalue; double doublevalue; diff --git a/liblwgeom/lwin_wkt_parse.y b/liblwgeom/lwin_wkt_parse.y index 1e03d41f0..0c1e63126 100644 --- a/liblwgeom/lwin_wkt_parse.y +++ b/liblwgeom/lwin_wkt_parse.y @@ -45,7 +45,7 @@ void wkt_yyerror(__attribute__((__unused__)) const char *str) * (eg, from within other functions in lwin_wkt.c) or from a threaded program. * Note that parser_result.wkinput picks up a reference to wktstr. */ -int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int parser_check_flags) +int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, const char *wktstr, int parser_check_flags) { int parse_rv = 0; @@ -107,7 +107,6 @@ int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int pars %} %locations -%define parse.error verbose %union { int integervalue; diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c index 3656af4e9..f8746f3bc 100644 --- a/liblwgeom/lwutil.c +++ b/liblwgeom/lwutil.c @@ -35,6 +35,7 @@ /* Global variables */ #include "../postgis_config.h" #include "liblwgeom_internal.h" +#include "stringbuffer.h" #include "lwgeom_log.h" /* Default allocators */ @@ -260,81 +261,48 @@ lwstrdup(const char* a) } /* - * Returns a new string which contains a maximum of maxlength characters starting - * from startpos and finishing at endpos (0-based indexing). If the string is - * truncated then the first or last characters are replaced by "..." as - * appropriate. - * - * The caller should specify start or end truncation by setting the truncdirection - * parameter as follows: - * 0 - start truncation (i.e. characters are removed from the beginning) - * 1 - end truncation (i.e. characters are removed from the end) + * Returns the characters to the left of the error position + * to a maximum of maxlength. */ - -char *lwmessage_truncate(char *str, int startpos, int endpos, int maxlength, int truncdirection) +char * +lwmessage_truncate(const char *str, int errpos, int maxlength) { - char *output; - char *outstart; + int str_sz; + int startpos; - /* Allocate space for new string */ - output = lwalloc(maxlength + 4); - output[0] = '\0'; + assert(str != NULL); + assert(errpos >= 0); + assert(maxlength > 0); - /* Start truncation */ - if (truncdirection == 0) + str_sz = strlen(str); + + stringbuffer_t sb; + stringbuffer_init(&sb); + + /* Error cannot be past end of WKT */ + if (errpos > str_sz) + errpos = str_sz; + + /* Go back maxlength from errpos but not past zero */ + startpos = errpos - maxlength; + if (startpos < 0) + startpos = 0; + + if (str_sz < maxlength) { - /* Calculate the start position */ - if (endpos - startpos < maxlength) - { - outstart = str + startpos; - strncat(output, outstart, endpos - startpos + 1); - } - else - { - if (maxlength >= 3) - { - /* Add "..." prefix */ - outstart = str + endpos + 1 - maxlength + 3; - strncat(output, "...", 4); - strncat(output, outstart, maxlength - 3); - } - else - { - /* maxlength is too small; just output "..." */ - strncat(output, "...", 4); - } - } + stringbuffer_append(&sb, str); + } + else + { + /* Add "..." prefix */ + stringbuffer_append(&sb, "..."); + stringbuffer_append_len(&sb, str + startpos, errpos-startpos); } - /* End truncation */ - if (truncdirection == 1) - { - /* Calculate the end position */ - if (endpos - startpos < maxlength) - { - outstart = str + startpos; - strncat(output, outstart, endpos - startpos + 1); - } - else - { - if (maxlength >= 3) - { - /* Add "..." suffix */ - outstart = str + startpos; - strncat(output, outstart, maxlength - 3); - strncat(output, "...", 4); - } - else - { - /* maxlength is too small; just output "..." */ - strncat(output, "...", 4); - } - } - } - - return output; + return stringbuffer_getstringcopy(&sb); } + int32_t clamp_srid(int32_t srid) { diff --git a/libpgcommon/lwgeom_pg.c b/libpgcommon/lwgeom_pg.c index 5e14aa132..fbbe5b73b 100644 --- a/libpgcommon/lwgeom_pg.c +++ b/libpgcommon/lwgeom_pg.c @@ -285,11 +285,11 @@ pg_parser_errhint(LWGEOM_PARSER_RESULT *lwg_parser_result) within the input stream cannot be matched */ if (lwg_parser_result->errlocation > 0) { - /* Return a copy of the input string start truncated - * at the error location */ + /* Return a short copy of the input string truncated at the error location */ hintbuffer = lwmessage_truncate( - (char *)lwg_parser_result->wkinput, 0, - lwg_parser_result->errlocation - 1, 40, 0); + lwg_parser_result->wkinput, /* wkt */ + lwg_parser_result->errlocation, /* errpos */ + 40); /* maxlen */ ereport(ERROR, (errmsg("%s", lwg_parser_result->message), ----------------------------------------------------------------------- Summary of changes: liblwgeom/liblwgeom.h.in | 4 +- liblwgeom/lwin_wkt.c | 2 +- liblwgeom/lwin_wkt.h | 2 +- liblwgeom/lwin_wkt_lex.c | 68 +-- liblwgeom/lwin_wkt_lex.l | 8 +- liblwgeom/lwin_wkt_parse.c | 1036 ++++++++++++++++---------------------------- liblwgeom/lwin_wkt_parse.h | 2 +- liblwgeom/lwin_wkt_parse.y | 3 +- liblwgeom/lwutil.c | 96 ++-- libpgcommon/lwgeom_pg.c | 8 +- 10 files changed, 449 insertions(+), 780 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 9 15:04:18 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:04:18 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.dd0455c9f6d711db687fd69d9d12370a@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"6f3355d3a1046c5f1af80e499cbad6f4f438dd9d/git" 6f3355d3/git]: {{{#!CommitTicketReference repository="git" revision="6f3355d3a1046c5f1af80e499cbad6f4f438dd9d" Rework the WKT parser position counter, which was dramatically over counting the parse position, resulting in bad memory accesses for long enough inputs with errors near the ends. References #6061 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 9 15:04:46 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 09 Apr 2026 22:04:46 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.0d21812813f64ba558578fac0c7fb7da@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 9 16:26:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 16:26:51 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-8-g4c42e775c Message-ID: <20260409232651.D3145181088@trac.osgeo.org> 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.2 has been updated via 4c42e775cf77ea08e3a5999c561f1e8ebcd03ddb (commit) from d491e6a68b19b3a049f72fb5e3b6b9f007e04295 (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 4c42e775cf77ea08e3a5999c561f1e8ebcd03ddb Author: Paul Ramsey Date: Thu Apr 9 16:26:45 2026 -0700 Ensure lexer is generated and committed diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index 0ba962865..b92567a18 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, - 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, + 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, + 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,42 +678,44 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[36] = +static const YY_CHAR yy_meta[53] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, - 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, - 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, - 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, - 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, - 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, - 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, - 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, - 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, - 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, + 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, + 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, + 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, + 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, + 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, + 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, + 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, + 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, + 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, + 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, - 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, - 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, - 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, - 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, - 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, - 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, - 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, - 67, 54, 39, 221, 221, 221 + 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, + 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, + 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, + 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, + 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, + 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, + 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, + 342, 351, 347, 391, 391, 391 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -732,68 +734,110 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[257] = +static const flex_int16_t yy_nxt[444] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, - 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, - 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, - 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, - 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, - 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, - 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, + 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, + 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, + 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, + 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, + 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, - 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, - 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, - 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, + 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, + 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, + 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, + 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, + 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, + 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, + 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, + 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, + 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, + 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, - 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, - 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, + 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, + 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, + 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, + 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, + 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, + 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, + 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, + 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, + 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, + 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, + + 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, + 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, + 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, + 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, + 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, + 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, + 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, + 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, + 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; -static const flex_int16_t yy_chk[257] = +static const flex_int16_t yy_chk[444] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, - 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, - 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, - 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, - 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, - 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, - 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, + 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, + 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, - 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, - 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, - 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, - 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, - 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, - 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, + 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, + 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, + 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, + 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, + 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, + 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, + 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, + 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, + 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, + + 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, + 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, + 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, + 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, + 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, + 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, + 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, + 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, + 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, + 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, + + 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, + 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, + 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, + 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, + 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, + 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, + 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, + 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, + 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, - 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -859,10 +903,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 862 "lwin_wkt_lex.c" +#line 906 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 865 "lwin_wkt_lex.c" +#line 909 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1080,7 +1124,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1083 "lwin_wkt_lex.c" +#line 1127 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1159,7 +1203,7 @@ YY_RULE_SETUP LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } YY_BREAK case 3: YY_RULE_SETUP @@ -1299,7 +1343,7 @@ YY_RULE_SETUP #line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1302 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index f2a4d963c..0f214e071 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -69,7 +69,7 @@ static void wkt_lexer_unknown() LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } SRID=-?[0-9]+ { LWDEBUG(5,"SRID"); ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwin_wkt_lex.c | 198 +++++++++++++++++++++++++++++------------------ liblwgeom/lwin_wkt_lex.l | 2 +- 2 files changed, 122 insertions(+), 78 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 9 16:29:36 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 9 Apr 2026 16:29:36 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-16-g77143e990 Message-ID: <20260409232936.50914180A7F@trac.osgeo.org> 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.4 has been updated via 77143e9908ff70d7d8085a2559de21fc85a9950c (commit) from a94af577180ed222ec217a20c4330713b40936ce (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 77143e9908ff70d7d8085a2559de21fc85a9950c Author: Paul Ramsey Date: Thu Apr 9 16:29:31 2026 -0700 Ensure lexer is generated and committed diff --git a/liblwgeom/lwin_wkt_lex.c b/liblwgeom/lwin_wkt_lex.c index 0ba962865..b92567a18 100644 --- a/liblwgeom/lwin_wkt_lex.c +++ b/liblwgeom/lwin_wkt_lex.c @@ -657,11 +657,11 @@ static const YY_CHAR yy_ec[256] = 12, 1, 1, 1, 13, 1, 14, 15, 16, 17, 18, 19, 20, 1, 1, 21, 22, 23, 24, 25, 1, 26, 27, 28, 29, 30, 1, 1, 31, 32, - 1, 1, 1, 1, 1, 1, 33, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 33, 1, 34, 35, - 34, 1, 1, 1, 1, 1, 1, 1, 1, 35, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 36, 37, 38, 39, 40, 1, 1, 41, 42, 43, + 44, 45, 1, 46, 47, 48, 49, 50, 1, 1, + 51, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -678,42 +678,44 @@ static const YY_CHAR yy_ec[256] = 1, 1, 1, 1, 1 } ; -static const YY_CHAR yy_meta[36] = +static const YY_CHAR yy_meta[53] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1 } ; static const flex_int16_t yy_base[177] = { 0, - 0, 0, 220, 221, 34, 36, 221, 221, 221, 31, - 209, 40, 221, 24, 196, 201, 196, 186, 33, 190, - 187, 31, 190, 52, 201, 0, 49, 221, 58, 61, - 184, 187, 182, 182, 182, 182, 183, 29, 52, 183, - 179, 181, 221, 190, 73, 185, 173, 167, 168, 173, - 178, 165, 79, 169, 160, 175, 221, 176, 159, 163, - 170, 154, 168, 156, 162, 221, 153, 69, 168, 156, - 157, 148, 151, 221, 147, 146, 71, 221, 149, 156, - 69, 153, 157, 146, 144, 141, 140, 136, 144, 139, - 133, 138, 145, 149, 148, 136, 130, 140, 133, 122, + 0, 0, 374, 391, 51, 53, 391, 391, 391, 48, + 362, 57, 391, 41, 41, 52, 49, 42, 59, 50, + 49, 56, 55, 76, 361, 0, 96, 391, 106, 109, + 54, 62, 61, 80, 86, 91, 97, 97, 101, 103, + 101, 106, 391, 193, 126, 113, 110, 107, 111, 123, + 132, 121, 149, 127, 122, 143, 391, 147, 132, 138, + 147, 133, 150, 140, 151, 391, 144, 156, 189, 153, + 156, 150, 160, 391, 160, 161, 196, 391, 169, 182, + 192, 186, 193, 184, 187, 186, 188, 186, 196, 195, + 191, 199, 210, 180, 76, 207, 203, 218, 217, 213, - 132, 125, 127, 69, 123, 221, 122, 131, 119, 131, - 113, 129, 119, 111, 124, 116, 107, 120, 123, 221, - 107, 105, 115, 108, 113, 114, 102, 100, 109, 113, - 104, 98, 97, 98, 100, 221, 221, 92, 221, 95, - 104, 90, 96, 85, 91, 92, 86, 88, 94, 80, - 85, 91, 221, 90, 85, 221, 221, 78, 85, 221, - 88, 78, 83, 221, 71, 79, 82, 74, 221, 79, - 67, 54, 39, 221, 221, 221 + 226, 221, 227, 231, 228, 391, 229, 240, 230, 245, + 229, 247, 239, 233, 249, 245, 238, 256, 265, 391, + 256, 257, 269, 266, 273, 276, 267, 267, 278, 284, + 278, 274, 275, 278, 282, 391, 391, 277, 391, 284, + 295, 286, 298, 294, 303, 306, 304, 308, 316, 305, + 312, 320, 391, 321, 319, 391, 391, 314, 323, 391, + 328, 320, 328, 391, 320, 331, 340, 338, 391, 350, + 342, 351, 347, 391, 391, 391 } ; static const flex_int16_t yy_def[177] = { 0, 176, 1, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 12, 12, 176, 176, 176, + 176, 176, 176, 176, 176, 12, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, @@ -732,68 +734,110 @@ static const flex_int16_t yy_def[177] = 176, 176, 176, 176, 176, 0 } ; -static const flex_int16_t yy_nxt[257] = +static const flex_int16_t yy_nxt[444] = { 0, 4, 5, 6, 7, 8, 4, 9, 10, 11, 12, 13, 4, 4, 14, 4, 15, 4, 16, 4, 4, 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, - 4, 23, 4, 4, 19, 24, 24, 24, 24, 25, - 26, 28, 28, 31, 28, 38, 28, 32, 29, 26, - 41, 53, 33, 24, 24, 30, 42, 176, 27, 28, - 28, 175, 28, 53, 28, 38, 44, 27, 44, 174, - 45, 54, 55, 30, 28, 28, 94, 28, 95, 28, - 66, 66, 45, 66, 88, 66, 79, 80, 116, 117, - 173, 89, 172, 171, 170, 90, 169, 91, 168, 167, + 4, 23, 4, 14, 4, 15, 4, 16, 4, 4, + 17, 18, 19, 4, 20, 4, 21, 22, 4, 4, + 4, 23, 24, 24, 24, 24, 25, 26, 28, 28, + 31, 28, 34, 28, 32, 29, 26, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 24, 24, 46, + 31, 42, 34, 47, 32, 95, 48, 35, 36, 33, + 37, 38, 30, 39, 40, 41, 43, 28, 28, 46, - 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, - 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, - 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, - 126, 125, 124, 123, 122, 121, 120, 119, 118, 115, - 114, 113, 112, 111, 110, 109, 108, 95, 95, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 93, 92, 87, 86, 85, 84, 83, 82, 81, - 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, - 68, 67, 65, 64, 63, 62, 61, 60, 59, 45, + 28, 42, 28, 47, 49, 27, 48, 28, 28, 50, + 28, 30, 28, 51, 44, 27, 44, 52, 45, 53, + 54, 55, 56, 57, 49, 58, 59, 28, 28, 50, + 28, 30, 28, 51, 60, 45, 61, 52, 62, 53, + 54, 55, 56, 57, 63, 58, 59, 64, 65, 67, + 66, 66, 68, 66, 60, 66, 61, 69, 62, 70, + 71, 72, 73, 74, 63, 75, 76, 64, 65, 67, + 77, 78, 68, 79, 80, 82, 83, 69, 84, 70, + 71, 72, 73, 74, 85, 75, 76, 86, 87, 95, + 77, 78, 92, 79, 80, 82, 83, 93, 84, 94, - 58, 57, 56, 52, 51, 50, 49, 48, 47, 46, - 27, 43, 40, 39, 37, 36, 35, 34, 27, 176, + 81, 95, 45, 96, 85, 97, 98, 86, 87, 88, + 99, 100, 92, 101, 102, 103, 89, 93, 104, 105, + 90, 106, 91, 96, 107, 97, 98, 108, 109, 88, + 99, 100, 110, 101, 102, 103, 89, 111, 104, 105, + 90, 106, 91, 112, 107, 113, 114, 108, 109, 115, + 116, 117, 110, 118, 119, 120, 121, 111, 122, 123, + 124, 125, 126, 112, 127, 113, 114, 128, 129, 115, + 116, 117, 130, 118, 119, 120, 121, 131, 122, 123, + 124, 125, 126, 132, 127, 133, 134, 128, 129, 135, + 136, 137, 130, 138, 139, 140, 141, 131, 142, 143, + + 144, 145, 146, 132, 147, 133, 134, 148, 149, 135, + 136, 137, 150, 138, 139, 140, 141, 151, 142, 143, + 144, 145, 146, 152, 147, 153, 154, 148, 149, 155, + 156, 157, 150, 158, 159, 160, 161, 151, 162, 163, + 164, 165, 166, 152, 167, 153, 154, 168, 169, 155, + 156, 157, 170, 158, 159, 160, 161, 171, 162, 163, + 164, 165, 166, 172, 167, 173, 174, 168, 169, 175, + 27, 27, 170, 176, 176, 176, 176, 171, 176, 176, + 176, 176, 176, 172, 176, 173, 174, 176, 176, 175, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; -static const flex_int16_t yy_chk[257] = +static const flex_int16_t yy_chk[444] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 5, 6, 6, 10, - 10, 12, 12, 14, 12, 19, 12, 14, 12, 12, - 22, 38, 14, 24, 24, 12, 22, 27, 27, 29, - 29, 173, 29, 38, 29, 19, 30, 29, 30, 172, - 30, 39, 39, 12, 45, 45, 81, 45, 81, 45, - 53, 53, 45, 53, 77, 53, 68, 68, 104, 104, - 171, 77, 170, 168, 167, 77, 166, 77, 165, 163, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 5, 5, 6, 6, 10, 10, 12, 12, + 14, 12, 15, 12, 14, 12, 12, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 24, 24, 31, + 14, 22, 15, 32, 14, 95, 33, 16, 17, 14, + 18, 19, 12, 20, 21, 22, 23, 27, 27, 31, - 162, 161, 159, 158, 155, 154, 152, 151, 150, 149, - 148, 147, 146, 145, 144, 143, 142, 141, 140, 138, - 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, - 125, 124, 123, 122, 121, 119, 118, 117, 116, 115, - 114, 113, 112, 111, 110, 109, 108, 107, 105, 103, - 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, - 92, 91, 90, 89, 88, 87, 86, 85, 84, 83, - 82, 80, 79, 76, 75, 73, 72, 71, 70, 69, - 67, 65, 64, 63, 62, 61, 60, 59, 58, 56, - 55, 54, 52, 51, 50, 49, 48, 47, 46, 44, + 27, 22, 27, 32, 34, 27, 33, 29, 29, 35, + 29, 27, 29, 36, 30, 29, 30, 37, 30, 38, + 39, 39, 40, 41, 34, 42, 46, 45, 45, 35, + 45, 27, 45, 36, 47, 45, 48, 37, 49, 38, + 39, 39, 40, 41, 50, 42, 46, 51, 52, 54, + 53, 53, 55, 53, 47, 53, 48, 56, 49, 58, + 59, 60, 61, 62, 50, 63, 64, 51, 52, 54, + 65, 67, 55, 68, 68, 70, 71, 56, 72, 58, + 59, 60, 61, 62, 73, 63, 64, 75, 76, 94, + 65, 67, 79, 68, 68, 70, 71, 80, 72, 81, + + 69, 81, 44, 82, 73, 83, 84, 75, 76, 77, + 85, 86, 79, 87, 88, 89, 77, 80, 90, 91, + 77, 92, 77, 82, 93, 83, 84, 96, 97, 77, + 85, 86, 98, 87, 88, 89, 77, 99, 90, 91, + 77, 92, 77, 100, 93, 101, 102, 96, 97, 103, + 104, 104, 98, 105, 107, 108, 109, 99, 110, 111, + 112, 113, 114, 100, 115, 101, 102, 116, 117, 103, + 104, 104, 118, 105, 107, 108, 109, 119, 110, 111, + 112, 113, 114, 121, 115, 122, 123, 116, 117, 124, + 125, 126, 118, 127, 128, 129, 130, 119, 131, 132, + + 133, 134, 135, 121, 138, 122, 123, 140, 141, 124, + 125, 126, 142, 127, 128, 129, 130, 143, 131, 132, + 133, 134, 135, 144, 138, 145, 146, 140, 141, 147, + 148, 149, 142, 150, 151, 152, 154, 143, 155, 158, + 159, 161, 162, 144, 163, 145, 146, 165, 166, 147, + 148, 149, 167, 150, 151, 152, 154, 168, 155, 158, + 159, 161, 162, 170, 163, 171, 172, 165, 166, 173, + 25, 11, 167, 3, 0, 0, 0, 168, 0, 0, + 0, 0, 0, 170, 0, 171, 172, 0, 0, 173, + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 42, 41, 40, 37, 36, 35, 34, 33, 32, 31, - 25, 23, 21, 20, 18, 17, 16, 15, 11, 3, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176 + 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, + 176, 176, 176 } ; static yy_state_type yy_last_accepting_state; @@ -859,10 +903,10 @@ static void wkt_lexer_unknown() #define NAN 0.0/0.0 #endif -#line 862 "lwin_wkt_lex.c" +#line 906 "lwin_wkt_lex.c" #define YY_NO_INPUT 1 /* Suppress the default implementations. */ -#line 865 "lwin_wkt_lex.c" +#line 909 "lwin_wkt_lex.c" #define INITIAL 0 @@ -1080,7 +1124,7 @@ YY_DECL #line 60 "lwin_wkt_lex.l" -#line 1083 "lwin_wkt_lex.c" +#line 1127 "lwin_wkt_lex.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { @@ -1159,7 +1203,7 @@ YY_RULE_SETUP LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } YY_BREAK case 3: YY_RULE_SETUP @@ -1299,7 +1343,7 @@ YY_RULE_SETUP #line 116 "lwin_wkt_lex.l" ECHO; YY_BREAK -#line 1302 "lwin_wkt_lex.c" +#line 1346 "lwin_wkt_lex.c" case YY_STATE_EOF(INITIAL): yyterminate(); diff --git a/liblwgeom/lwin_wkt_lex.l b/liblwgeom/lwin_wkt_lex.l index f2a4d963c..0f214e071 100644 --- a/liblwgeom/lwin_wkt_lex.l +++ b/liblwgeom/lwin_wkt_lex.l @@ -69,7 +69,7 @@ static void wkt_lexer_unknown() LWDEBUG(5,"DOUBLE NAN"); wkt_yylval.doublevalue = NAN; return DOUBLE_TOK; -} + } SRID=-?[0-9]+ { LWDEBUG(5,"SRID"); ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwin_wkt_lex.c | 198 +++++++++++++++++++++++++++++------------------ liblwgeom/lwin_wkt_lex.l | 2 +- 2 files changed, 122 insertions(+), 78 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Apr 10 11:28:58 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 10 Apr 2026 18:28:58 -0000 Subject: [PostGIS] #6066: Pg19 + topology crash on regression test In-Reply-To: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> References: <049.386c2f37cc2e531405b6897efb643855@osgeo.org> Message-ID: <064.4944c504a9d391dcdb5c36911ac7f8bc@osgeo.org> #6066: Pg19 + topology crash on regression test -----------------------+-------------------------------- Reporter: pramsey | Owner: robe Type: defect | Status: closed Priority: blocker | Milestone: PostGIS PostgreSQL Component: topology | Version: master Resolution: fixed | Keywords: -----------------------+-------------------------------- Changes (by pramsey): * resolution: => fixed * status: new => closed Comment: PgSQL has been patched at https://github.com/postgres/postgres/commit/34a307862930056e1976471d6d81a5e2efc148df -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 10 18:16:09 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:16:09 -0000 Subject: [PostGIS] #6067: MacOS CI failing on topology topogeo_addlinestring, validatetopology Message-ID: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> #6067: MacOS CI failing on topology topogeo_addlinestring, validatetopology ----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Keywords: | ----------------------+--------------------------- GHA MacOS CI appears to be failing on 2 topology tests: {{{ Run tests: 260 Failed: 2 make: *** [check-regress] Error 2 ---- BEGIN REGRESSION DIFFS (/tmp/pgis_reg) ---- ---- /tmp/pgis_reg/test_236_diff ---- --- ./topology/test/regress/topogeo_addlinestring_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_236_out 2026-04-09 22:11:09 @@ -236,3 +236,4 @@ t6062.edges|t t6064.1|t t6064.2|t +t6064.check.final|hole not in advertised face|-5| ---- /tmp/pgis_reg/test_254_diff ---- --- ./topology/test/regress/validatetopology_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_254_out 2026-04-09 22:11:12 @@ -46,4 +46,3 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| -#6065|invalidities|hole not in advertised face|-4| ---- END REGRESSION DIFFS ---- Stopping `postgresql at 17`... (might take a while) ==> Successfully stopped `postgresql at 17` (label: homebrew.mxcl.postgresql at 17) }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 10 18:19:11 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:19:11 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology (was: MacOS CI failing on topology topogeo_addlinestring, validatetopology) In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.03a2c67a46cc65f90a9c9a27a9902f87@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by robe): * summary: MacOS CI failing on topology topogeo_addlinestring, validatetopology => MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology Old description: > GHA MacOS CI appears to be failing on 2 topology tests: > > {{{ > Run tests: 260 > Failed: 2 > make: *** [check-regress] Error 2 > ---- BEGIN REGRESSION DIFFS (/tmp/pgis_reg) ---- > ---- /tmp/pgis_reg/test_236_diff ---- > --- ./topology/test/regress/topogeo_addlinestring_expected > 2026-04-09 22:05:58 > +++ /tmp/pgis_reg/test_236_out 2026-04-09 22:11:09 > @@ -236,3 +236,4 @@ > t6062.edges|t > t6064.1|t > t6064.2|t > +t6064.check.final|hole not in advertised face|-5| > ---- /tmp/pgis_reg/test_254_diff ---- > --- ./topology/test/regress/validatetopology_expected 2026-04-09 > 22:05:58 > +++ /tmp/pgis_reg/test_254_out 2026-04-09 22:11:12 > @@ -46,4 +46,3 @@ > #5766.2|no bbox|("face has wrong mbr",0,) > #5766.2|overlapping bbox|("face has wrong mbr",0,) > #5766.2|disjoint bbox| > -#6065|invalidities|hole not in advertised face|-4| > ---- END REGRESSION DIFFS ---- > Stopping `postgresql at 17`... (might take a while) > ==> Successfully stopped `postgresql at 17` (label: > homebrew.mxcl.postgresql at 17) > }}} New description: GHA MacOS CI appears to be failing on 2 topology tests: https://github.com/postgis/postgis/runs/70695353289 {{{ Run tests: 260 Failed: 2 make: *** [check-regress] Error 2 ---- BEGIN REGRESSION DIFFS (/tmp/pgis_reg) ---- ---- /tmp/pgis_reg/test_236_diff ---- --- ./topology/test/regress/topogeo_addlinestring_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_236_out 2026-04-09 22:11:09 @@ -236,3 +236,4 @@ t6062.edges|t t6064.1|t t6064.2|t +t6064.check.final|hole not in advertised face|-5| ---- /tmp/pgis_reg/test_254_diff ---- --- ./topology/test/regress/validatetopology_expected 2026-04-09 22:05:58 +++ /tmp/pgis_reg/test_254_out 2026-04-09 22:11:12 @@ -46,4 +46,3 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| -#6065|invalidities|hole not in advertised face|-4| ---- END REGRESSION DIFFS ---- Stopping `postgresql at 17`... (might take a while) ==> Successfully stopped `postgresql at 17` (label: homebrew.mxcl.postgresql at 17) }}} Winnie shows similar and I think my local system has these failures as well: From winnie: https://winnie.postgis.net/job/PostGIS_EDB_Regress_winnie/22345/consoleFull {{{ ./topology/test/regress/topogeo_addlinestring .. failed (diff expected obtained: E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_240_diff) ----------------------------------------------------------------------------- --- ./topology/test/regress/topogeo_addlinestring_expected 2026-04-09 17:19:20.643388100 -0400 +++ E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_240_out 2026-04-09 18:50:05.337133800 -0400 @@ -236,3 +236,4 @@ t6062.edges|t t6064.1|t t6064.2|t +t6064.check.final|hole not in advertised face|-5| ----------------------------------------------------------------------------- ./topology/test/regress/validatetopology .. failed (diff expected obtained: E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_258_diff) ----------------------------------------------------------------------------- --- ./topology/test/regress/validatetopology_expected 2026-04-09 17:19:20.674641200 -0400 +++ E:/jenkins/postgis/tmp/3.7.0dev_pg15_geos3.15_gdal3.9.2w64/test_258_out 2026-04-09 18:50:33.651908900 -0400 @@ -46,4 +46,3 @@ #5766.2|no bbox|("face has wrong mbr",0,) #5766.2|overlapping bbox|("face has wrong mbr",0,) #5766.2|disjoint bbox| -#6065|invalidities|hole not in advertised face|-4| ---------------------------------------------------------------------------- }}} -- Comment: I thi -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 10 18:21:19 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:21:19 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.2adabd665bb9b9df1af180a5fd076c26@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): FWIW on winnie, all was good until April 8th with this commit https://gitea.osgeo.org/postgis/postgis/commit/7e3d523cda37faa3efdb8daed91e73df6a9fe864 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 10 18:26:47 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 01:26:47 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.78634efed1a54e6e679f89fb1186dd49@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): Confirmed MacOS started failing after the same commit that made winnie unhappy. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sat Apr 11 04:09:57 2026 From: trac at osgeo.org (PostGIS) Date: Sat, 11 Apr 2026 11:09:57 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.b1a872e1204bd532e7f3c28627b9c899@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The failure is due to `ptarray_signed_area` being unable to compute non- zero area of a triangle with outgoing spikes (collapsed parts). The use of `long double` fixed this on some systems but it's a partial fix as it depends on platform, apparently. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Sat Apr 11 15:26:20 2026 From: git at osgeo.org (git at osgeo.org) Date: Sat, 11 Apr 2026 15:26:20 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-14-g273382ac8 Message-ID: <20260411222621.08ED5138EB5@trac.osgeo.org> 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.3 has been updated via 273382ac81dd25af5236f69c36d6414e28928fa1 (commit) from 1e9706654e856e794701d7573e448986944956e5 (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 273382ac81dd25af5236f69c36d6414e28928fa1 Author: Paul Ramsey Date: Sat Apr 11 15:25:45 2026 -0700 Remove Cirrus-CI diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 50d3bbfe7..000000000 --- a/.cirrus.yml +++ /dev/null @@ -1,38 +0,0 @@ -task: - only_if: true - name: FreeBSD - alias: test-freebsd - env: - MAKE_FLAGS: -j 8 - - install_script: - - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf - - ASSUME_ALWAYS_YES=yes pkg bootstrap -f - - pkg install -y bison postgresql13-server gmake libxml2 autoconf automake libtool pkgconf iconv pcre proj gdal sfcgal geos libxslt cunit protobuf-c json-c postgresql13-contrib - - projsync --system-directory --source-id us_noaa - - projsync --system-directory --source-id ch_swisstopo - - patch_script: - # will be removed - - find . -name "*.pl" | xargs sed -i -r 's|/usr/bin/perl|/usr/bin/env perl|' - build_script: - - ./autogen.sh - - ./configure PKG_CONFIG=/usr/local/bin/pkgconf CFLAGS="-isystem /usr/local/include -Wall -fno-omit-frame-pointer -Werror" LDFLAGS="-L/usr/local/lib" --with-libiconv-prefix=/usr/local --without-gui --without-interrupt-tests --with-topology --without-raster --with-sfcgal=/usr/local/bin/sfcgal-config --with-address-standardizer --with-protobuf - - service postgresql oneinitdb - - service postgresql onestart - - su postgres -c "createuser -s `whoami`" - - gmake -j8 || { service postgresql onestop; exit 1;} - - gmake -j8 check RUNTESTFLAGS="-v" || { service postgresql onestop; exit 1;} - - gmake -j8 install || { service postgresql onestop; exit 1;} - - gmake -j8 check RUNTESTFLAGS="-v --extension" || { service postgresql onestop; exit 1;} - - gmake -j8 check RUNTESTFLAGS="-v --dumprestore" || { service postgresql onestop; exit 1;} - - service postgresql onestop - - freebsd_instance: - cpu: ${NCPU} - memory: 24G - matrix: - - name: 14.2-RELEASE - freebsd_instance: - image_family: freebsd-14-2 - ----------------------------------------------------------------------- Summary of changes: .cirrus.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .cirrus.yml hooks/post-receive -- PostGIS From git at osgeo.org Sat Apr 11 15:27:25 2026 From: git at osgeo.org (git at osgeo.org) Date: Sat, 11 Apr 2026 15:27:25 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-14-g66fcfd047 Message-ID: <20260411222725.407FA138EBA@trac.osgeo.org> 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.5 has been updated via 66fcfd047860ee8c675738fe0a40356b7a42ec32 (commit) from 5c1ed575d82b33355f2ed338e5c41c30e99d2f48 (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 66fcfd047860ee8c675738fe0a40356b7a42ec32 Author: Paul Ramsey Date: Sat Apr 11 15:27:16 2026 -0700 Remove Cirrus-CI diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index c1eaaf1c9..000000000 --- a/.cirrus.yml +++ /dev/null @@ -1,92 +0,0 @@ -task: - only_if: $CIRRUS_BRANCH =~ 'pull/.*' - name: FreeBSD - alias: test-freebsd - #env: - #MAKE_FLAGS: -j 8 - - install_script: - - sed -i.bak -e 's,pkg+http://pkg.FreeBSD.org/\${ABI}/quarterly,pkg+http://pkg.FreeBSD.org/\${ABI}/latest,' /etc/pkg/FreeBSD.conf - - ASSUME_ALWAYS_YES=yes pkg bootstrap -f - - pkg install -y - autoconf - automake - bison - cunit - docbook - gdal - geos - gmake - iconv - json-c - libtool - libxml2 - libxslt - pcre - pkgconf - postgresql13-contrib - postgresql13-server - proj - protobuf-c - sfcgal - - projsync --system-directory --source-id us_noaa - - projsync --system-directory --source-id ch_swisstopo - - patch_script: - # will be removed - - find . -name "*.pl" | xargs sed -i -r 's|/usr/bin/perl|/usr/bin/env perl|' - build_script: - - ./autogen.sh - - ./configure PKG_CONFIG=/usr/local/bin/pkgconf CFLAGS="-isystem /usr/local/include -Wall -fno-omit-frame-pointer -Werror" LDFLAGS="-L/usr/local/lib" --with-libiconv-prefix=/usr/local --without-gui --with-topology --without-raster --with-sfcgal=/usr/local/bin/sfcgal-config --with-address-standardizer --with-protobuf - - service postgresql oneinitdb - - service postgresql onestart - - su postgres -c "createuser -s `whoami`" - - gmake || { service postgresql onestop; exit 1;} - - gmake check RUNTESTFLAGS="-v" || { service postgresql onestop; exit 1;} - - gmake install || { service postgresql onestop; exit 1;} - - gmake check RUNTESTFLAGS="-v --extension" || { service postgresql onestop; exit 1;} - - gmake check RUNTESTFLAGS="-v --extension --dumprestore" || { service postgresql onestop; exit 1;} - - service postgresql onestop - - freebsd_instance: - cpu: ${NCPU} - memory: 24G - matrix: - - name: 14.2-RELEASE - freebsd_instance: - image_family: freebsd-14-2 - -task: - name: macOS - alias: test-macos - test_script: - - brew update - - brew install - autoconf - automake - cunit - docbook - docbook-xsl - gdal - geos - gpp - json-c - libtool - pcre2 - pkg-config - postgresql at 14 - proj - sfcgal - - ./autogen.sh - - ./configure --without-gui --without-interrupt-tests --without-topology --without-raster --with-sfcgal --with-address-standardizer --without-protobuf --with-pgconfig=/opt/homebrew/opt/postgresql at 14/bin/pg_config - - brew services start postgresql at 14 - - postgres -V - - make -j8 || { brew services stop postgresql at 14; exit 1;} - - make -j8 check || { brew services stop postgresql at 14; exit 1;} - - brew services stop postgresql at 14 - - matrix: - macos_instance: - image: ghcr.io/cirruslabs/macos-ventura-base:latest - # macos_instance: - # image: ghcr.io/cirruslabs/macos-monterey-base:latest ----------------------------------------------------------------------- Summary of changes: .cirrus.yml | 92 ------------------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 .cirrus.yml hooks/post-receive -- PostGIS From trac at osgeo.org Sun Apr 12 00:46:29 2026 From: trac at osgeo.org (PostGIS) Date: Sun, 12 Apr 2026 07:46:29 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.cd030d58397ec5d8de8d129a7b4d3396@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): For the record: the failing tests are for bugs #6065 and #6064 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 00:50:21 2026 From: trac at osgeo.org (PostGIS) Date: Sun, 12 Apr 2026 07:50:21 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.ef12248defae66fb61635b73b1574883@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by strk): * resolution: fixed => * status: closed => reopened Comment: Since the fix for this is platform specific (see #6067) I'm reopening the ticket. One idea to make the hole/she'll determination more robust: we compute on which side of the leftmost edges a farther-left point falls. If the side matches the side of the edge in the ring (positive if left, negative if right) we can tell it's an hole (clockwise orientation). Note that if the leftmost edge appears both as positive and negative we can avoid computing side and directly state it's an hole (shells can only have flat components on the interior). -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 00:53:06 2026 From: trac at osgeo.org (PostGIS) Date: Sun, 12 Apr 2026 07:53:06 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.c61c7f0e2bcf9ea5bb0a121026a29e8e@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Changes (by strk): * resolution: fixed => * status: closed => reopened Comment: Since the fix for this was platform specific (see #6067) I'm reopening the ticket. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 01:04:08 2026 From: trac at osgeo.org (PostGIS) Date: Sun, 12 Apr 2026 08:04:08 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.210cd554c86e8068d78583418b368a16@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Another thing to try would be https://postgis.net/docs/CG_Orientation.html to check if it's more robust (would introduce dependency on SFCGAL extension though) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 17:43:56 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 00:43:56 -0000 Subject: [PostGIS] #6068: Alphashape regress failure on berrie64 Message-ID: <046.13872e45f711927107c1134ef7683cdf@osgeo.org> #6068: Alphashape regress failure on berrie64 ---------------------+----------------------------- Reporter: robe | Owner: Lo?c Bartoletti Type: defect | Status: new Priority: blocker | Milestone: PostGIS 3.7.0 Component: sfcgal | Version: 3.5.x Keywords: | ---------------------+----------------------------- {{{ 16:33:27 PostgreSQL 17.7 on aarch64-unknown-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit 16:33:27 Postgis 3.7.0dev - (6f3355d) - 2026-04-12 20:25:16 16:33:27 scripts 3.7.0dev 6f3355d 16:33:27 raster scripts 3.7.0dev 6f3355d 16:33:27 GEOS: 3.11.6dev-CAPI-1.17.5 16:33:27 PROJ: 9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/home/jenkins/.local/share/proj DATABASE_PATH=/usr/share/proj/proj.db 16:33:27 SFCGAL: 2.3.0 16:33:27 GDAL: GDAL 3.10.3, released 2025/04/01 16:35:24 sfcgal/regress/alphashape_components .. failed (diff expected obtained: /tmp/pgis_reg/test_176_diff) 16:35:24 ----------------------------------------------------------------------------- 16:35:24 --- ./sfcgal/regress/alphashape_components_expected 2026-04-12 14:24:07.860004234 -0600 16:35:24 +++ /tmp/pgis_reg/test_176_out 2026-04-12 14:35:24.722091552 -0600 16:35:24 @@ -1,2 +1,2 @@ 16:35:24 -CG_Optimalalphashape_2components|MULTIPOLYGON(((8.3 11.8,6.2 12.1,4.1 11.9,2.6 11.2,1.1 10.1,0.3 8.2,0.1 6.1,0.4 4,1.2 2.3,2.5 1,4.2 0.3,6 0,8.1 0.1,10.1 0.2,9.2 2.4,7.8 2.2,6 2.3,3.6 6.2,7.6 9.8,9.1 9.9,10.2 11.1,8.3 11.8)),((55.6 12.1,55.8 15,54.3 15.2,52.9 10.6,52.7 7.3,52.8 4.1,46.9 2.8,43.3 7.1,43.1 10.4,43.1 15.3,41.9 15.6,40.5 15.2,40.2 12.3,40.4 9,39.8 6.2,40.1 3.1,40.3 0.4,42.1 0.3,44.2 0.2,49.8 -0.2,52.6 0.1,55.4 0.5,55.7 3.3,55.5 6,55.9 9.2,55.6 12.1))) 16:35:24 -CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((5.5 8.5,5 9,4.5 9.5,4 10,3 10,2 10,1 10,0.5 10,0.23 10,0.03 9.82,0 9,0 8,0 7,0 6,0 5,0 4,0 3,0 2,0 1,0 0,0.5 0,1 0,2 0,3 0,4 0,5 0,5.5 0.5,6 1,6 2,5.8 2.5,5.5 3,5 3.5,4.5 4,4 4.5,5 5,5.5 5.5,6 6,6 7,6 8,5.5 8.5),(0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 1,0.5 2),(0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 6,0.5 7)),((17.5 8.5,17 9,16.5 9.5,16 10,15 10,14 10,13 10,12.5 10,12 10,12 9,12 8,12 7,12 6,12 5,12 4,12 3,12 2,12 1,12 0,12.5 0,13 1,13 2,13 3,13 4,13 5,14 5,15 5,16 5,17 5,17.5 5.5,18 6,18 7,18 7.3,18 8,17.5 8.5),(12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6,12.5 7))) 16:35:24 +CG_Optimalalphashape_2components|POLYGON((0.1 6.1,0.3 8.2,1.1 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 4,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 10.6,54.3 15.2,55.8 15,0.1 6.1)) 16:35:24 +CG_OptimalAlphaShape_hole_2components|POLYGON((0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,12 0,12 1,12 2,12 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,0 0),(0.5 1,0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 6,0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 1),(12.5 6,12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6)) 16:35:24 ----------------------------------------------------------------------------- }}} I'll rebuild against latest sfcgal master to see if issue goes away -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 17:45:21 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 00:45:21 -0000 Subject: [PostGIS] #6068: Alphashape regress failure on berrie64 In-Reply-To: <046.13872e45f711927107c1134ef7683cdf@osgeo.org> References: <046.13872e45f711927107c1134ef7683cdf@osgeo.org> Message-ID: <061.9087073b4230c90bacce6e9922c22947@osgeo.org> #6068: Alphashape regress failure on berrie64 ----------------------+-------------------------------------- Reporter: robe | Owner: Lo?c Bartoletti Type: defect | Status: new Priority: blocker | Milestone: Website Management, Bots Component: sfcgal | Version: 3.5.x Resolution: | Keywords: ----------------------+-------------------------------------- Changes (by robe): * milestone: PostGIS 3.7.0 => Website Management, Bots Old description: > {{{ > 16:33:27 PostgreSQL 17.7 on aarch64-unknown-linux-gnu, compiled by gcc > (Debian 14.2.0-19) 14.2.0, 64-bit > 16:33:27 Postgis 3.7.0dev - (6f3355d) - 2026-04-12 20:25:16 > 16:33:27 scripts 3.7.0dev 6f3355d > 16:33:27 raster scripts 3.7.0dev 6f3355d > 16:33:27 GEOS: 3.11.6dev-CAPI-1.17.5 > 16:33:27 PROJ: 9.6.0 NETWORK_ENABLED=OFF > URL_ENDPOINT=https://cdn.proj.org > USER_WRITABLE_DIRECTORY=/home/jenkins/.local/share/proj > DATABASE_PATH=/usr/share/proj/proj.db > 16:33:27 SFCGAL: 2.3.0 > 16:33:27 GDAL: GDAL 3.10.3, released 2025/04/01 > 16:35:24 sfcgal/regress/alphashape_components .. failed (diff expected > obtained: /tmp/pgis_reg/test_176_diff) > 16:35:24 > ----------------------------------------------------------------------------- > 16:35:24 --- ./sfcgal/regress/alphashape_components_expected > 2026-04-12 14:24:07.860004234 -0600 > 16:35:24 +++ /tmp/pgis_reg/test_176_out 2026-04-12 14:35:24.722091552 > -0600 > 16:35:24 @@ -1,2 +1,2 @@ > > 16:35:24 -CG_Optimalalphashape_2components|MULTIPOLYGON(((8.3 11.8,6.2 > 12.1,4.1 11.9,2.6 11.2,1.1 10.1,0.3 8.2,0.1 6.1,0.4 4,1.2 2.3,2.5 1,4.2 > 0.3,6 0,8.1 0.1,10.1 0.2,9.2 2.4,7.8 2.2,6 2.3,3.6 6.2,7.6 9.8,9.1 > 9.9,10.2 11.1,8.3 11.8)),((55.6 12.1,55.8 15,54.3 15.2,52.9 10.6,52.7 > 7.3,52.8 4.1,46.9 2.8,43.3 7.1,43.1 10.4,43.1 15.3,41.9 15.6,40.5 > 15.2,40.2 12.3,40.4 9,39.8 6.2,40.1 3.1,40.3 0.4,42.1 0.3,44.2 0.2,49.8 > -0.2,52.6 0.1,55.4 0.5,55.7 3.3,55.5 6,55.9 9.2,55.6 12.1))) > 16:35:24 -CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((5.5 8.5,5 > 9,4.5 9.5,4 10,3 10,2 10,1 10,0.5 10,0.23 10,0.03 9.82,0 9,0 8,0 7,0 6,0 > 5,0 4,0 3,0 2,0 1,0 0,0.5 0,1 0,2 0,3 0,4 0,5 0,5.5 0.5,6 1,6 2,5.8 > 2.5,5.5 3,5 3.5,4.5 4,4 4.5,5 5,5.5 5.5,6 6,6 7,6 8,5.5 8.5),(0.5 2,0.5 > 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 > 0.5,1 0.5,0.5 1,0.5 2),(0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 > 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 6,0.5 > 7)),((17.5 8.5,17 9,16.5 9.5,16 10,15 10,14 10,13 10,12.5 10,12 10,12 > 9,12 8,12 7,12 6,12 5,12 4,12 3,12 2,12 1,12 0,12.5 0,13 1,13 2,13 3,13 > 4,13 5,14 5,15 5,16 5,17 5,17.5 5.5,18 6,18 7,18 7.3,18 8,17.5 8.5),(12.5 > 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 > 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6,12.5 > 7))) > 16:35:24 +CG_Optimalalphashape_2components|POLYGON((0.1 6.1,0.3 8.2,1.1 > 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 > 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 > 4,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 > 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 > 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 > 10.6,54.3 15.2,55.8 15,0.1 6.1)) > 16:35:24 +CG_OptimalAlphaShape_hole_2components|POLYGON((0 0,0 1,0 2,0 > 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 > 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 > 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,12 0,12 1,12 2,12 > 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 > 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 > 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,0 0),(0.5 1,0.5 2,0.5 3,1 4,2 4,3 > 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 > 6,0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 > 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 1),(12.5 6,12.5 7,12.5 8,12.5 > 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 > 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6)) > 16:35:24 > ----------------------------------------------------------------------------- > }}} > > I'll rebuild against latest sfcgal master to see if issue goes away New description: {{{ 16:33:27 PostgreSQL 17.7 on aarch64-unknown-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit 16:33:27 Postgis 3.7.0dev - (6f3355d) - 2026-04-12 20:25:16 16:33:27 scripts 3.7.0dev 6f3355d 16:33:27 raster scripts 3.7.0dev 6f3355d 16:33:27 GEOS: 3.11.6dev-CAPI-1.17.5 16:33:27 PROJ: 9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/home/jenkins/.local/share/proj DATABASE_PATH=/usr/share/proj/proj.db 16:33:27 SFCGAL: 2.3.0 16:33:27 GDAL: GDAL 3.10.3, released 2025/04/01 16:35:24 sfcgal/regress/alphashape_components .. failed (diff expected obtained: /tmp/pgis_reg/test_176_diff) 16:35:24 ----------------------------------------------------------------------------- 16:35:24 --- ./sfcgal/regress/alphashape_components_expected 2026-04-12 14:24:07.860004234 -0600 16:35:24 +++ /tmp/pgis_reg/test_176_out 2026-04-12 14:35:24.722091552 -0600 16:35:24 @@ -1,2 +1,2 @@ 16:35:24 -CG_Optimalalphashape_2components|MULTIPOLYGON(((8.3 11.8,6.2 12.1,4.1 11.9,2.6 11.2,1.1 10.1,0.3 8.2,0.1 6.1,0.4 4,1.2 2.3,2.5 1,4.2 0.3,6 0,8.1 0.1,10.1 0.2,9.2 2.4,7.8 2.2,6 2.3,3.6 6.2,7.6 9.8,9.1 9.9,10.2 11.1,8.3 11.8)),((55.6 12.1,55.8 15,54.3 15.2,52.9 10.6,52.7 7.3,52.8 4.1,46.9 2.8,43.3 7.1,43.1 10.4,43.1 15.3,41.9 15.6,40.5 15.2,40.2 12.3,40.4 9,39.8 6.2,40.1 3.1,40.3 0.4,42.1 0.3,44.2 0.2,49.8 -0.2,52.6 0.1,55.4 0.5,55.7 3.3,55.5 6,55.9 9.2,55.6 12.1))) 16:35:24 -CG_OptimalAlphaShape_hole_2components|MULTIPOLYGON(((5.5 8.5,5 9,4.5 9.5,4 10,3 10,2 10,1 10,0.5 10,0.23 10,0.03 9.82,0 9,0 8,0 7,0 6,0 5,0 4,0 3,0 2,0 1,0 0,0.5 0,1 0,2 0,3 0,4 0,5 0,5.5 0.5,6 1,6 2,5.8 2.5,5.5 3,5 3.5,4.5 4,4 4.5,5 5,5.5 5.5,6 6,6 7,6 8,5.5 8.5),(0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 1,0.5 2),(0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 6,0.5 7)),((17.5 8.5,17 9,16.5 9.5,16 10,15 10,14 10,13 10,12.5 10,12 10,12 9,12 8,12 7,12 6,12 5,12 4,12 3,12 2,12 1,12 0,12.5 0,13 1,13 2,13 3,13 4,13 5,14 5,15 5,16 5,17 5,17.5 5.5,18 6,18 7,18 7.3,18 8,17.5 8.5),(12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6,12.5 7))) 16:35:24 +CG_Optimalalphashape_2components|POLYGON((0.1 6.1,0.3 8.2,1.1 10.1,2.6 11.2,4.1 11.9,6.2 12.1,8.3 11.8,10.2 11.1,9.1 9.9,7.6 9.8,3.6 6.2,6 2.3,7.8 2.2,9.2 2.4,10.1 0.2,8.1 0.1,6 0,4.2 0.3,2.5 1,1.2 2.3,0.4 4,55.6 12.1,55.9 9.2,55.5 6,55.7 3.3,55.4 0.5,52.6 0.1,49.8 -0.2,44.2 0.2,42.1 0.3,40.3 0.4,40.1 3.1,39.8 6.2,40.4 9,40.2 12.3,40.5 15.2,41.9 15.6,43.1 15.3,43.1 10.4,43.3 7.1,46.9 2.8,52.8 4.1,52.7 7.3,52.9 10.6,54.3 15.2,55.8 15,0.1 6.1)) 16:35:24 +CG_OptimalAlphaShape_hole_2components|POLYGON((0 0,0 1,0 2,0 3,0 4,0 5,0 6,0 7,0 8,0 9,0.03 9.82,0.23 10,0.5 10,1 10,2 10,3 10,4 10,4.5 9.5,5 9,5.5 8.5,6 8,6 7,6 6,5.5 5.5,5 5,4 4.5,4.5 4,5 3.5,5.5 3,5.8 2.5,6 2,6 1,5.5 0.5,5 0,4 0,3 0,2 0,1 0,0.5 0,12 0,12 1,12 2,12 3,12 4,12 5,12 6,12 7,12 8,12 9,12 10,12.5 10,13 10,14 10,15 10,16 10,16.5 9.5,17 9,17.5 8.5,18 8,18 7.3,18 7,18 6,17.5 5.5,17 5,16 5,15 5,14 5,13 5,13 4,13 3,13 2,13 1,12.5 0,0 0),(0.5 1,0.5 2,0.5 3,1 4,2 4,3 4,4 4,4.5 3.5,5 3,5.1 2.5,5.5 2,5.5 1,5 0.5,4 0.5,3 0.5,2 0.5,1 0.5,0.5 6,0.5 7,0.5 8,0.5 9,1 9.5,2 9.5,3 9.5,4 9.5,4.5 9,5 8.5,5.5 8,5.5 7,5.5 6.5,5.5 6,5 5.5,4 5.5,3 5.5,2 5.5,1 5.5,0.5 1),(12.5 6,12.5 7,12.5 8,12.5 9,13 9.5,14 9.5,15 9.5,16 9.5,16.5 9,17 8.5,17.5 8,17.5 7.4,17.5 7,17.5 6.5,17.5 6,17 5.5,16 5.5,15 5.5,14 5.5,13 5.5,12.5 6)) 16:35:24 ----------------------------------------------------------------------------- }}} I'll rebuild against latest sfcgal master to see if issue goes away -- -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 17:45:30 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 00:45:30 -0000 Subject: [PostGIS] #6068: Alphashape regress failure on berrie64 In-Reply-To: <046.13872e45f711927107c1134ef7683cdf@osgeo.org> References: <046.13872e45f711927107c1134ef7683cdf@osgeo.org> Message-ID: <061.9a1e15895903710f65a53c25360a59f5@osgeo.org> #6068: Alphashape regress failure on berrie64 ----------------------+-------------------------------------- Reporter: robe | Owner: robe Type: defect | Status: new Priority: blocker | Milestone: Website Management, Bots Component: sfcgal | Version: 3.5.x Resolution: | Keywords: ----------------------+-------------------------------------- Changes (by robe): * owner: Lo?c Bartoletti => robe -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Sun Apr 12 23:54:49 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 06:54:49 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.838fffc316b1aad1a3be264d4be8c390@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): It looks like `CG_Orientation` gets the orietation right: {{{ strk at strk=# with ring as ( select * from topology.getRingEdges('t6065', -1) ), geoms as ( select r.sequence seq, r.edge as sid, e.geom from ring r join t6065.edge e on ( abs(r.edge) = e.edge_id ) ), shell as ( select ST_MakePolygon(ST_MakeLine( case when sid > 0 then geom else ST_Reverse(geom) end order by seq)) g from geoms ) select g, ST_IsValidDetail(g), st_area(g), st_isPolygonCCW(g), CG_Orientation(g) from shell; -[ RECORD 1 ]----+----------------------------------------------------------------------------------------------------------------------------------------------------------- g | 01030000000100000004000000FD613B270D6C314031AA543619475140890205230D6C31408177583619475140A4613B270D6C31402FAA543619475140FD613B270D6C314031AA543619475140 st_isvaliddetail | (t,,) st_area | 4.127836234257221e-21 st_ispolygonccw | t cg_orientation | -1 strk at strk=# with ring as ( select * from topology.getRingEdges('t6065', 1) ), geoms as ( select r.sequence seq, r.edge as sid, e.geom from ring r join t6065.edge e on ( abs(r.edge) = e.edge_id ) ), shell as ( select ST_MakePolygon(ST_MakeLine( case when sid > 0 then geom else ST_Reverse(geom) end order by seq)) g from geoms ) select g, ST_IsValidDetail(g), st_area(g), st_isPolygonCCW(g), CG_Orientation(g) from shell; -[ RECORD 1 ]----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- g | 0103000000010000000A000000890205230D6C31408177583619475140FD613B270D6C314031AA5436194751405D58985776943140195EE965DE47514085FFA6647B9F31408FC1C62B394851405D58985776943140195EE965DE475140FD613B270D6C314031AA543619475140A4613B270D6C31402FAA543619475140890205230D6C31408177583619475140320205230D6C31407E77583619475140890205230D6C31408177583619475140 st_isvaliddetail | (f,"Ring Self- intersection",01010000005D58985776943140195EE965DE475140) st_area | 6.732252036060648e-20 st_ispolygonccw | t cg_orientation | 1 }}} Note how `ST_IsPolygonCCW` gives the same response for the two rings while `CG_Orientation` changes between them. The above is the answer with POSTGIS="3.7.0dev 3.6.0rc2-417-g67ff872e2" (before the long double introduction). With the `long double` on my system both `ST_IsPolygonCCW` and `CG_Orientation` agree on winding order of the problematic ring: {{{ 0103000000010000000A000000890205230D6C31408177583619475140FD613B270D6C314031AA5436194751405D58985776943140195EE965DE47514085FFA6647B9F31408FC1C62B394851405D58985776943140195EE965DE475140FD613B270D6C314031AA543619475140A4613B270D6C31402FAA543619475140890205230D6C31408177583619475140320205230D6C31407E77583619475140890205230D6C31408177583619475140 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Apr 13 00:36:03 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 00:36:03 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-440-g6adcabe8e Message-ID: <20260413073603.4E48113AC5A@trac.osgeo.org> 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 6adcabe8e99b2c5a67b45cfe4758cc08ee332376 (commit) from 6f3355d3a1046c5f1af80e499cbad6f4f438dd9d (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 6adcabe8e99b2c5a67b45cfe4758cc08ee332376 Author: Sandro Santilli Date: Mon Apr 13 09:35:46 2026 +0200 Move SFGAL orientation test in its own file diff --git a/sfcgal/regress/orientation.sql b/sfcgal/regress/orientation.sql new file mode 100644 index 000000000..b9b4857d7 --- /dev/null +++ b/sfcgal/regress/orientation.sql @@ -0,0 +1,4 @@ +SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); +SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); +SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); +SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); diff --git a/sfcgal/regress/orientation_expected b/sfcgal/regress/orientation_expected new file mode 100644 index 000000000..58b10f126 --- /dev/null +++ b/sfcgal/regress/orientation_expected @@ -0,0 +1,4 @@ +CG_Orientation_1|-1 +CG_Orientation_2|1 +CG_Orientation_1|-1 +CG_Orientation_2|1 diff --git a/sfcgal/regress/regress_sfcgal.sql b/sfcgal/regress/regress_sfcgal.sql index 881c19439..5d35443c2 100644 --- a/sfcgal/regress/regress_sfcgal.sql +++ b/sfcgal/regress/regress_sfcgal.sql @@ -26,8 +26,6 @@ ELSE END; SELECT 'CG_ForceLHR', ST_AsText(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); SELECT 'CG_MinkowskiSum', ST_AsText(CG_MinkowskiSum('LINESTRING(0 0,4 0)','POLYGON((0 0,1 0,1 1,0 1,0 0))')); SELECT 'CG_ConstrainedDelaunayTriangles', ST_AsText(CG_ConstrainedDelaunayTriangles('GEOMETRYCOLLECTION(POINT(0 0), POLYGON((2 2, 2 -2, 4 0, 2 2)))')); SELECT 'CG_3DConvexHull', CG_3DArea(CG_3DConvexHull('MULTIPOINTZ(0 0 5, 1 5 3, 5 7 6, 9 5 3 , 5 7 5, 6 3 5)'))::numeric(10,4); @@ -62,8 +60,6 @@ ELSE END; SELECT 'CG_ForceLHR', ST_AsText(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); SELECT 'CG_MinkowskiSum', ST_AsText(CG_MinkowskiSum('LINESTRING(0 0,4 0)','POLYGON((0 0,1 0,1 1,0 1,0 0))')); SELECT 'CG_ConstrainedDelaunayTriangles', ST_AsText(CG_ConstrainedDelaunayTriangles('GEOMETRYCOLLECTION(POINT(0 0), POLYGON((2 2, 2 -2, 4 0, 2 2)))')); SELECT 'CG_3DConvexHull', CG_3DArea(CG_3DConvexHull('MULTIPOINTZ(0 0 5, 1 5 3, 5 7 6, 9 5 3 , 5 7 5, 6 3 5)'))::numeric(10,4); diff --git a/sfcgal/regress/regress_sfcgal_expected b/sfcgal/regress/regress_sfcgal_expected index bdbc702da..261cb63d3 100644 --- a/sfcgal/regress/regress_sfcgal_expected +++ b/sfcgal/regress/regress_sfcgal_expected @@ -6,8 +6,6 @@ CG_Extrude_point|LINESTRING Z (0 0 0,1 0 0) CG_Extrude_line|POLYHEDRALSURFACE Z (((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0))) CG_Extrude_surface|POLYHEDRALSURFACE Z (((1 1 0,1 0 0,0 1 0,1 1 0)),((0 1 1,1 0 1,1 1 1,0 1 1)),((1 0 0,0 0 0,0 1 0,1 0 0)),((0 1 1,0 0 1,1 0 1,0 1 1)),((1 0 0,1 1 0,1 1 1,1 0 1,1 0 0)),((1 1 0,0 1 0,0 1 1,1 1 1,1 1 0)),((0 1 0,0 0 0,0 0 1,0 1 1,0 1 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0))) CG_ForceLHR|POLYGON((0 0,1 0,1 1,0 1,0 0)) -CG_Orientation_1|-1 -CG_Orientation_2|1 CG_MinkowskiSum|MULTIPOLYGON(((0 0,1 0,5 0,5 1,4 1,0 1,0 0))) CG_ConstrainedDelaunayTriangles|TIN(((4 0,2 2,2 -2,4 0)),((2 2,0 0,2 -2,2 2))) CG_3DConvexHull|80.9227 @@ -19,8 +17,6 @@ CG_Extrude_point|LINESTRING Z (0 0 0,1 0 0) CG_Extrude_line|POLYHEDRALSURFACE Z (((0 0 0,1 0 0,1 1 0,0 1 0,0 0 0))) CG_Extrude_surface|POLYHEDRALSURFACE Z (((1 1 0,1 0 0,0 1 0,1 1 0)),((0 1 1,1 0 1,1 1 1,0 1 1)),((1 0 0,0 0 0,0 1 0,1 0 0)),((0 1 1,0 0 1,1 0 1,0 1 1)),((1 0 0,1 1 0,1 1 1,1 0 1,1 0 0)),((1 1 0,0 1 0,0 1 1,1 1 1,1 1 0)),((0 1 0,0 0 0,0 0 1,0 1 1,0 1 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0))) CG_ForceLHR|POLYGON((0 0,1 0,1 1,0 1,0 0)) -CG_Orientation_1|-1 -CG_Orientation_2|1 CG_MinkowskiSum|MULTIPOLYGON(((0 0,1 0,5 0,5 1,4 1,0 1,0 0))) CG_ConstrainedDelaunayTriangles|TIN(((4 0,2 2,2 -2,4 0)),((2 2,0 0,2 -2,2 2))) CG_3DConvexHull|80.9227 diff --git a/sfcgal/regress/tests.mk.in b/sfcgal/regress/tests.mk.in index 557edcd2f..8dd78b2ec 100644 --- a/sfcgal/regress/tests.mk.in +++ b/sfcgal/regress/tests.mk.in @@ -15,7 +15,8 @@ POSTGIS_SFCGAL_VERSION=@POSTGIS_SFCGAL_VERSION@ TESTS += \ $(top_srcdir)/sfcgal/regress/regress_sfcgal \ - $(top_srcdir)/sfcgal/regress/approximatemedialaxis.sql + $(top_srcdir)/sfcgal/regress/approximatemedialaxis.sql \ + $(top_srcdir)/sfcgal/regress/orientation.sql ifeq ($(shell expr "$(POSTGIS_SFCGAL_VERSION)" ">=" 10401),1) TESTS += \ ----------------------------------------------------------------------- Summary of changes: sfcgal/regress/orientation.sql | 4 ++++ sfcgal/regress/orientation_expected | 4 ++++ sfcgal/regress/regress_sfcgal.sql | 4 ---- sfcgal/regress/regress_sfcgal_expected | 4 ---- sfcgal/regress/tests.mk.in | 3 ++- 5 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 sfcgal/regress/orientation.sql create mode 100644 sfcgal/regress/orientation_expected hooks/post-receive -- PostGIS From trac at osgeo.org Mon Apr 13 00:42:26 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 07:42:26 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.16f2d80286791d7f89205941aeeddc25@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): For the record GEOS CoordSeq_isCCW would also fail to determine the CLOCKWISE orientation of the problematic ring (which is the correct answer). I've filed a GEOS ticket for that: https://github.com/libgeos/geos/issues/1425 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Apr 13 01:17:48 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 01:17:48 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-441-gaf86ae406 Message-ID: <20260413081748.6DAC013B34F@trac.osgeo.org> 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 af86ae40655391f797ad95cf97b6e7fca5cb7e33 (commit) from 6adcabe8e99b2c5a67b45cfe4758cc08ee332376 (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 af86ae40655391f797ad95cf97b6e7fca5cb7e33 Author: Sandro Santilli Date: Mon Apr 13 10:17:37 2026 +0200 Drop duplicated tests diff --git a/sfcgal/regress/orientation.sql b/sfcgal/regress/orientation.sql index b9b4857d7..f30ed17b7 100644 --- a/sfcgal/regress/orientation.sql +++ b/sfcgal/regress/orientation.sql @@ -1,4 +1,2 @@ SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); diff --git a/sfcgal/regress/orientation_expected b/sfcgal/regress/orientation_expected index 58b10f126..6479c3034 100644 --- a/sfcgal/regress/orientation_expected +++ b/sfcgal/regress/orientation_expected @@ -1,4 +1,2 @@ CG_Orientation_1|-1 CG_Orientation_2|1 -CG_Orientation_1|-1 -CG_Orientation_2|1 ----------------------------------------------------------------------- Summary of changes: sfcgal/regress/orientation.sql | 2 -- sfcgal/regress/orientation_expected | 2 -- 2 files changed, 4 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Apr 13 06:50:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 06:50:16 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-442-gdca869b30 Message-ID: <20260413135016.C6931189E16@trac.osgeo.org> 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 dca869b309a2d7fda9fd1c173a326540af9f34d8 (commit) from af86ae40655391f797ad95cf97b6e7fca5cb7e33 (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 dca869b309a2d7fda9fd1c173a326540af9f34d8 Author: Sandro Santilli Date: Mon Apr 13 15:48:22 2026 +0200 Add SFCGAL test for ring orientation case requiring higher precision References #6065 diff --git a/sfcgal/regress/orientation.sql b/sfcgal/regress/orientation.sql index f30ed17b7..a237b636c 100644 --- a/sfcgal/regress/orientation.sql +++ b/sfcgal/regress/orientation.sql @@ -1,2 +1,4 @@ -SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); +SELECT 'CG_Orientation_1', CG_Orientation(CG_ForceLHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -- Left hand rule: counterclockwise (interior is on the left side) +SELECT 'CG_Orientation_2', CG_Orientation(ST_ForceRHR('POLYGON((0 0,0 1,1 1,1 0,0 0))')); -- Right hand rule: clockwise (interior is on the right side) +SELECT 'CG_Orientation_3', CG_Orientation('POLYGON((0 0,0 1,1 1,1 0,0 0))'); -- clockwise +SELECT 't6065', CG_Orientation('0103000000010000000A000000890205230D6C31408177583619475140FD613B270D6C314031AA5436194751405D58985776943140195EE965DE47514085FFA6647B9F31408FC1C62B394851405D58985776943140195EE965DE475140FD613B270D6C314031AA543619475140A4613B270D6C31402FAA543619475140890205230D6C31408177583619475140320205230D6C31407E77583619475140890205230D6C31408177583619475140'); diff --git a/sfcgal/regress/orientation_expected b/sfcgal/regress/orientation_expected index 6479c3034..a6d7c7cc3 100644 --- a/sfcgal/regress/orientation_expected +++ b/sfcgal/regress/orientation_expected @@ -1,2 +1,4 @@ CG_Orientation_1|-1 CG_Orientation_2|1 +CG_Orientation_3|1 +t6065|1 ----------------------------------------------------------------------- Summary of changes: sfcgal/regress/orientation.sql | 6 ++++-- sfcgal/regress/orientation_expected | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Apr 13 06:50:19 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 13:50:19 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.da52921df48c58719774ca061006ef08@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by Sandro Santilli ): In [changeset:"dca869b309a2d7fda9fd1c173a326540af9f34d8/git" dca869b/git]: {{{#!CommitTicketReference repository="git" revision="dca869b309a2d7fda9fd1c173a326540af9f34d8" Add SFCGAL test for ring orientation case requiring higher precision References #6065 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 13 09:54:48 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 16:54:48 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.942c42c9dfdfe6a455fd578ad5baabad@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): I was wrong: `GEOS_CoordSeq_isCCW` gives the right answer. An experiemental branch using GEOS for ring orientation is in https://gitea.osgeo.org/postgis/postgis/pulls/291 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 13 10:08:03 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 17:08:03 -0000 Subject: [PostGIS] #6069: Build failure on 3.6 CI latest Message-ID: <049.c96cd0e773dde3738abf7b88a13aab0f@osgeo.org> #6069: Build failure on 3.6 CI latest ---------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Keywords: | ---------------------+--------------------------- But puke of complaints about incorrect prototypes and un-tagged fallthrough cases. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Apr 13 11:12:16 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 11:12:16 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-23-gf02a7536c Message-ID: <20260413181217.BCF0918BE43@trac.osgeo.org> 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.6 has been updated via f02a7536cb3597d2db400fdd0e4747f03e29b6e2 (commit) via 44ac9bc46984fd649ebdc9076aecd0e678136314 (commit) via 16d388906c641f702d5e5c669f311e59103ed216 (commit) via 7372f89acd938ff9c6f46d2822b34b4089d5d07c (commit) via af79a7a0cb8d5e9219f4c3bfcca64fbc0b927eb0 (commit) via 72c3a7a5e7006c228e796324087be3c117793ea1 (commit) via 4c85dfa2c69fcdc12cd428f033529301908ca251 (commit) via 75254c60697241cd8a8804bbc37feb9a0a1890f1 (commit) via fa01f2bdc0b17b84000198df12b44ac4ed6dd1da (commit) from bf475b54959c3605055e783496f3d8474d696e9e (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 f02a7536cb3597d2db400fdd0e4747f03e29b6e2 Author: Paul Ramsey Date: Mon Apr 13 11:11:52 2026 -0700 Catch all FALLTHROUGH cases in a standard way, move to strict K&R style prototypes for functions with no arguments, cleans up warnings in recent compilers References #6069 diff --git a/NEWS b/NEWS index 1d69eb34d..022ab4bea 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ topogeometry corruption: - #6060, fully quality calls to helper functions (Paul Ramsey) - #6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) - #6061, WKT parser produces incorrect error locations (Paul Ramsey) +- #6069, Build warnings / CI failures on K&R style, fallthroughs (Paul Ramsey) PostGIS 3.6.2 diff --git a/deps/uthash/include/uthash.h b/deps/uthash/include/uthash.h index af0546472..ecb883871 100644 --- a/deps/uthash/include/uthash.h +++ b/deps/uthash/include/uthash.h @@ -136,6 +136,23 @@ typedef unsigned char uint8_t; #endif +#ifndef FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201703L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__clang__) + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(__GNUC__) && __GNUC__ >= 7 + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(_MSC_VER) && _MSC_VER >= 1910 + #define FALLTHROUGH [[fallthrough]] + #else + #define FALLTHROUGH ((void)0) + #endif +#endif + + /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS 32U /* initial number of buckets */ #define HASH_INITIAL_NUM_BUCKETS_LOG2 5U /* lg2 of initial number of buckets */ @@ -681,16 +698,16 @@ do { } \ hashv += (unsigned)(keylen); \ switch ( _hj_k ) { \ - case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); /* FALLTHROUGH */ \ - case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); /* FALLTHROUGH */ \ - case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); /* FALLTHROUGH */ \ - case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); /* FALLTHROUGH */ \ - case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); /* FALLTHROUGH */ \ - case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); /* FALLTHROUGH */ \ - case 5: _hj_j += _hj_key[4]; /* FALLTHROUGH */ \ - case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); /* FALLTHROUGH */ \ - case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); /* FALLTHROUGH */ \ - case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); /* FALLTHROUGH */ \ + case 11: hashv += ( (unsigned)_hj_key[10] << 24 ); FALLTHROUGH; \ + case 10: hashv += ( (unsigned)_hj_key[9] << 16 ); FALLTHROUGH; \ + case 9: hashv += ( (unsigned)_hj_key[8] << 8 ); FALLTHROUGH; \ + case 8: _hj_j += ( (unsigned)_hj_key[7] << 24 ); FALLTHROUGH; \ + case 7: _hj_j += ( (unsigned)_hj_key[6] << 16 ); FALLTHROUGH; \ + case 6: _hj_j += ( (unsigned)_hj_key[5] << 8 ); FALLTHROUGH; \ + case 5: _hj_j += _hj_key[4]; FALLTHROUGH; \ + case 4: _hj_i += ( (unsigned)_hj_key[3] << 24 ); FALLTHROUGH; \ + case 3: _hj_i += ( (unsigned)_hj_key[2] << 16 ); FALLTHROUGH; \ + case 2: _hj_i += ( (unsigned)_hj_key[1] << 8 ); FALLTHROUGH; \ case 1: _hj_i += _hj_key[0]; \ } \ HASH_JEN_MIX(_hj_i, _hj_j, hashv); \ @@ -1224,4 +1241,4 @@ typedef struct UT_hash_handle { unsigned hashv; /* result of hash-fcn(key) */ } UT_hash_handle; -#endif /* UTHASH_H */ \ No newline at end of file +#endif /* UTHASH_H */ diff --git a/deps/wagyu/lwgeom_wagyu.cpp b/deps/wagyu/lwgeom_wagyu.cpp index 0afbd144b..fc6e359c6 100644 --- a/deps/wagyu/lwgeom_wagyu.cpp +++ b/deps/wagyu/lwgeom_wagyu.cpp @@ -250,7 +250,7 @@ lwgeom_wagyu_clip_by_box(const LWGEOM *geom, const GBOX *bbox) } const char * -libwagyu_version() +libwagyu_version(void) { static char str[50] = {0}; snprintf( @@ -260,13 +260,13 @@ libwagyu_version() } void -lwgeom_wagyu_interruptRequest() +lwgeom_wagyu_interruptRequest(void) { mapbox::geometry::wagyu::interrupt_request(); } void -lwgeom_wagyu_interruptReset() +lwgeom_wagyu_interruptReset(void) { mapbox::geometry::wagyu::interrupt_reset(); } diff --git a/deps/wagyu/lwgeom_wagyu.h b/deps/wagyu/lwgeom_wagyu.h index 9e557f679..52963e23a 100644 --- a/deps/wagyu/lwgeom_wagyu.h +++ b/deps/wagyu/lwgeom_wagyu.h @@ -52,17 +52,17 @@ LWGEOM *lwgeom_wagyu_clip_by_box(const LWGEOM *geom, const GBOX *bbox); * Returns a pointer to the static string representing the Wagyu release * being used (Should not be freed) */ -const char *libwagyu_version(); +const char *libwagyu_version(void); /** * Requests wagyu to stop processing. In this case it will return NULL */ -void lwgeom_wagyu_interruptRequest(); +void lwgeom_wagyu_interruptRequest(void); /** * Cancels request to stop processing. */ -void lwgeom_wagyu_interruptReset(); +void lwgeom_wagyu_interruptReset(void); #ifdef __cplusplus } diff --git a/extensions/address_standardizer/khash.h b/extensions/address_standardizer/khash.h index 09d817013..398df18a0 100644 --- a/extensions/address_standardizer/khash.h +++ b/extensions/address_standardizer/khash.h @@ -116,7 +116,7 @@ static const double __ac_HASH_UPPER = 0.77; khkey_t *keys; \ khval_t *vals; \ } kh_##name##_t; \ - static inline kh_##name##_t *kh_init_##name() { \ + static inline kh_##name##_t *kh_init_##name(void) { \ return (kh_##name##_t*)calloc(1,sizeof(kh_##name##_t)); \ } \ static inline void kh_destroy_##name(kh_##name##_t *h) \ @@ -276,7 +276,7 @@ static inline khint_t __ac_X31_hash_string(const char *s) #define khash_t(name) kh_##name##_t -#define kh_init(name) kh_init_##name() +#define kh_init(name) kh_init_##name(void) #define kh_destroy(name, h) kh_destroy_##name(h) #define kh_clear(name, h) kh_clear_##name(h) #define kh_resize(name, h, s) kh_resize_##name(h, s) diff --git a/extensions/address_standardizer/parseaddress-api.c b/extensions/address_standardizer/parseaddress-api.c index dd37c277b..1e21e235c 100644 --- a/extensions/address_standardizer/parseaddress-api.c +++ b/extensions/address_standardizer/parseaddress-api.c @@ -43,7 +43,7 @@ #endif const char *get_state_regex(char *st); -const char *parseaddress_cvsid(); +const char *parseaddress_cvsid(void); char *clean_leading_punct(char *s); const char *get_state_regex(char *st) diff --git a/extensions/address_standardizer/standard.c b/extensions/address_standardizer/standard.c index 9fed23411..07c3348c4 100644 --- a/extensions/address_standardizer/standard.c +++ b/extensions/address_standardizer/standard.c @@ -314,7 +314,7 @@ typedef struct STDADDR_s { // define as required */ -STANDARDIZER *std_init() +STANDARDIZER *std_init(void) { STANDARDIZER *std; diff --git a/liblwgeom/cunit/cu_ptarray.c b/liblwgeom/cunit/cu_ptarray.c index 6d8ea2faa..8cf3d8c11 100644 --- a/liblwgeom/cunit/cu_ptarray.c +++ b/liblwgeom/cunit/cu_ptarray.c @@ -314,7 +314,7 @@ static void test_ptarray_isccw(void) lwpoly_free(poly); } -static void test_ptarray_signed_area() +static void test_ptarray_signed_area(void) { LWLINE *line; double area; @@ -340,7 +340,7 @@ static void test_ptarray_signed_area() } -static void test_ptarray_contains_point() +static void test_ptarray_contains_point(void) { /* int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt, int *winding_number) */ @@ -440,7 +440,7 @@ static void test_ptarray_contains_point() lwline_free(lwline); } -static void test_ptarrayarc_contains_point() +static void test_ptarrayarc_contains_point(void) { /* int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt) */ @@ -578,7 +578,7 @@ static void test_ptarrayarc_contains_point() lwcircstring_free(lwcirc); } -static void test_ptarray_scale() +static void test_ptarray_scale(void) { LWLINE *line; POINTARRAY *pa; @@ -627,7 +627,7 @@ static void test_ptarray_scale() lwline_free(line); } -static void test_ptarray_scroll() +static void test_ptarray_scroll(void) { LWLINE *line; POINTARRAY *pa; @@ -664,7 +664,7 @@ static void test_ptarray_scroll() lwline_free(line); } -static void test_ptarray_closest_vertex_2d() +static void test_ptarray_closest_vertex_2d(void) { LWLINE *line; POINTARRAY *pa; @@ -696,7 +696,7 @@ static void test_ptarray_closest_vertex_2d() lwline_free(line); } -static void test_ptarray_closest_segment_2d() +static void test_ptarray_closest_segment_2d(void) { LWLINE *line; POINTARRAY *pa; diff --git a/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c b/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c index b3bbcbcd0..84be8a36a 100644 --- a/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c +++ b/liblwgeom/cunit/cu_remove_irrelevant_points_for_view.c @@ -15,7 +15,7 @@ #include "lwgeom_remove_irrelevant_points_for_view.h" -// test case for lwgeom_remove_irrelevant_points_for_view() + static void test_lwgeom_remove_irrelevant_points_for_view(void) { LWGEOM *geom; diff --git a/liblwgeom/cunit/cu_tester.c b/liblwgeom/cunit/cu_tester.c index 0df215893..708b8070c 100644 --- a/liblwgeom/cunit/cu_tester.c +++ b/liblwgeom/cunit/cu_tester.c @@ -30,12 +30,12 @@ cu_debuglogger(int level, const char *fmt, va_list ap); /* ADD YOUR SUITE SETUP FUNCTION HERE (1 of 2) */ -extern void print_suite_setup(); -extern void algorithms_suite_setup(); -extern void boundary_suite_setup(); -extern void buildarea_suite_setup(); -extern void clean_suite_setup(); -extern void clip_by_rect_suite_setup(); +extern void print_suite_setup(void); +extern void algorithms_suite_setup(void); +extern void boundary_suite_setup(void); +extern void buildarea_suite_setup(void); +extern void clean_suite_setup(void); +extern void clip_by_rect_suite_setup(void); extern void force_dims_suite_setup(void); extern void force_sfs_suite_setup(void); extern void geodetic_suite_setup(void); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 610807120..48c591a59 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -72,6 +72,21 @@ #define STR_IEQUALS(A, B) (strcasecmp((A), (B)) == 0) #define STR_ISTARTS(A, B) (strncasecmp((A), (B), strlen((B))) == 0) +#ifndef FALLTHROUGH + #if defined(__cplusplus) && __cplusplus >= 201703L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L + #define FALLTHROUGH [[fallthrough]] + #elif defined(__clang__) + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(__GNUC__) && __GNUC__ >= 7 + #define FALLTHROUGH __attribute__((fallthrough)) + #elif defined(_MSC_VER) && _MSC_VER >= 1910 + #define FALLTHROUGH [[fallthrough]] + #else + #define FALLTHROUGH ((void)0) + #endif +#endif /* * this will change to NaN when I figure out how to diff --git a/liblwgeom/lwboundingcircle.c b/liblwgeom/lwboundingcircle.c index ba6bc40d7..673b40a1f 100644 --- a/liblwgeom/lwboundingcircle.c +++ b/liblwgeom/lwboundingcircle.c @@ -33,7 +33,7 @@ typedef struct { } SUPPORTING_POINTS; static SUPPORTING_POINTS* -supporting_points_create() +supporting_points_create(void) { SUPPORTING_POINTS* s = lwalloc(sizeof(SUPPORTING_POINTS)); s->p1 = NULL; @@ -214,7 +214,7 @@ calculate_mbc(const POINT2D** points, uint32_t max_n, SUPPORTING_POINTS* support } static LWBOUNDINGCIRCLE* -lwboundingcircle_create() +lwboundingcircle_create(void) { LWBOUNDINGCIRCLE* c = lwalloc(sizeof(LWBOUNDINGCIRCLE)); c->center = lwalloc(sizeof(POINT2D)); diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c index 8d5a0f0e1..99e51b0ca 100644 --- a/liblwgeom/lwgeom_api.c +++ b/liblwgeom/lwgeom_api.c @@ -35,7 +35,7 @@ #define str(s) #s const char * -lwgeom_version() +lwgeom_version(void) { static char *ptr = NULL; static char buf[256]; @@ -655,11 +655,11 @@ interpolate_point4d(const POINT4D *A, const POINT4D *B, POINT4D *I, double F) int _lwgeom_interrupt_requested = 0; void -lwgeom_request_interrupt() { +lwgeom_request_interrupt(void) { _lwgeom_interrupt_requested = 1; } void -lwgeom_cancel_interrupt() { +lwgeom_cancel_interrupt(void) { _lwgeom_interrupt_requested = 0; } diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c index 1fe21fa16..d53bd071d 100644 --- a/libpgcommon/lwgeom_transform.c +++ b/libpgcommon/lwgeom_transform.c @@ -96,7 +96,7 @@ PROJSRSDestroyPortalCache(void *portalCache) * If it doesn't exist, make a new blank one and return it. */ PROJSRSCache * -GetPROJSRSCache() +GetPROJSRSCache(void) { PROJSRSCache* cache = PROJ_CACHE; if (!cache) diff --git a/libpgcommon/lwgeom_transform.h b/libpgcommon/lwgeom_transform.h index be0ae1978..c42d21530 100644 --- a/libpgcommon/lwgeom_transform.h +++ b/libpgcommon/lwgeom_transform.h @@ -57,7 +57,7 @@ typedef struct srs_precision } srs_precision; /* Prototypes */ -PROJSRSCache* GetPROJSRSCache(); +PROJSRSCache* GetPROJSRSCache(void); int lwproj_lookup(int32_t srid_from, int32_t srid_to, LWPROJ **pj); int lwproj_is_latlong(const LWPROJ *pj); int spheroid_init_from_srid(int32_t srid, SPHEROID *s); diff --git a/loader/cunit/cu_tester.c b/loader/cunit/cu_tester.c index d47d5b1aa..37fd810ec 100644 --- a/loader/cunit/cu_tester.c +++ b/loader/cunit/cu_tester.c @@ -20,7 +20,7 @@ ** Returns a CUE_SUCCESS on successful running, another ** CUnit error code on failure. */ -int main() +int main(void) { /* initialize the CUnit test registry */ diff --git a/postgis/gserialized_typmod.c b/postgis/gserialized_typmod.c index 2c9f64b56..daeaf1ad3 100644 --- a/postgis/gserialized_typmod.c +++ b/postgis/gserialized_typmod.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "utils/elog.h" #include "utils/array.h" diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c index 1e126ce82..e4900c943 100644 --- a/postgis/lwgeom_functions_basic.c +++ b/postgis/lwgeom_functions_basic.c @@ -2717,8 +2717,10 @@ Datum LWGEOM_angle(PG_FUNCTION_ARGS) { default: /*always executed*/ for (j = 0; j <= i; j++) + { PG_FREE_IF_COPY(seri_geoms[j], j); - /*FALLTHROUGH*/ + } + FALLTHROUGH; case 1: lwpgerror("Empty geometry"); PG_RETURN_NULL(); diff --git a/postgis/lwgeom_geos_prepared.c b/postgis/lwgeom_geos_prepared.c index 2f971a64c..79dafad7e 100644 --- a/postgis/lwgeom_geos_prepared.c +++ b/postgis/lwgeom_geos_prepared.c @@ -336,7 +336,7 @@ PrepGeomCacheCleaner(GeomCache *cache) } static GeomCache* -PrepGeomCacheAllocator() +PrepGeomCacheAllocator(void) { PrepGeomCache* prepcache = palloc(sizeof(PrepGeomCache)); memset(prepcache, 0, sizeof(PrepGeomCache)); diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c index 58bbac8d6..077a2b55e 100644 --- a/postgis/lwgeom_transform.c +++ b/postgis/lwgeom_transform.c @@ -409,7 +409,7 @@ srs_tuple_from_entry(const struct srs_entry* entry, TupleDesc tuple_desc) } static struct srs_data * -srs_state_init() +srs_state_init(void) { struct srs_data *state = palloc0(sizeof(*state)); state->capacity = 8192; diff --git a/postgis/postgis_module.c b/postgis/postgis_module.c index 8f7bb312e..ae8a6a907 100644 --- a/postgis/postgis_module.c +++ b/postgis/postgis_module.c @@ -46,7 +46,7 @@ PG_MODULE_MAGIC; -static void interrupt_geos_callback() +static void interrupt_geos_callback(void) { #ifdef WIN32 if (UNBLOCKED_SIGNAL_QUEUE()) @@ -65,7 +65,7 @@ static void interrupt_geos_callback() } } -static void interrupt_liblwgeom_callback() +static void interrupt_liblwgeom_callback(void) { #ifdef WIN32 if (UNBLOCKED_SIGNAL_QUEUE()) diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c index 6e4b9da38..128394139 100644 --- a/raster/rt_pg/rtpg_mapalgebra.c +++ b/raster/rt_pg/rtpg_mapalgebra.c @@ -6543,8 +6543,7 @@ Datum RASTER_mapAlgebra2(PG_FUNCTION_ARGS) switch (extenttype) { case ET_FIRST: i = 0; - /* fall through */ - __attribute__((fallthrough)); + FALLTHROUGH; case ET_SECOND: if (i > 1) i = 1; diff --git a/raster/rt_pg/rtpg_pixel.c b/raster/rt_pg/rtpg_pixel.c index 2bfecf4d4..9aa65ebea 100644 --- a/raster/rt_pg/rtpg_pixel.c +++ b/raster/rt_pg/rtpg_pixel.c @@ -349,7 +349,7 @@ struct rtpg_dumpvalues_arg_t { bool **nodata; }; -static rtpg_dumpvalues_arg rtpg_dumpvalues_arg_init() { +static rtpg_dumpvalues_arg rtpg_dumpvalues_arg_init(void) { rtpg_dumpvalues_arg arg = NULL; arg = palloc(sizeof(struct rtpg_dumpvalues_arg_t)); @@ -1292,7 +1292,7 @@ struct rtpg_setvaluesgv_geomval_t { rt_raster mask; }; -static rtpg_setvaluesgv_arg rtpg_setvaluesgv_arg_init() { +static rtpg_setvaluesgv_arg rtpg_setvaluesgv_arg_init(void) { rtpg_setvaluesgv_arg arg = palloc(sizeof(struct rtpg_setvaluesgv_arg_t)); if (arg == NULL) { elog(ERROR, "rtpg_setvaluesgv_arg_init: Could not allocate memory for function arguments"); diff --git a/raster/rt_pg/rtpg_statistics.c b/raster/rt_pg/rtpg_statistics.c index bffdf0e6b..03219f74e 100644 --- a/raster/rt_pg/rtpg_statistics.c +++ b/raster/rt_pg/rtpg_statistics.c @@ -513,7 +513,7 @@ rtpg_summarystats_arg_destroy(rtpg_summarystats_arg arg) { } static rtpg_summarystats_arg -rtpg_summarystats_arg_init() { +rtpg_summarystats_arg_init(void) { rtpg_summarystats_arg arg = NULL; arg = palloc(sizeof(struct rtpg_summarystats_arg_t)); diff --git a/raster/test/cunit/cu_band_basics.c b/raster/test/cunit/cu_band_basics.c index 5219442e9..6a67f5d28 100644 --- a/raster/test/cunit/cu_band_basics.c +++ b/raster/test/cunit/cu_band_basics.c @@ -25,7 +25,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_band_metadata() { +static void test_band_metadata(void) { rt_raster rast = NULL; uint8_t *data = NULL; rt_band band = NULL; @@ -147,7 +147,7 @@ static void test_band_metadata() { cu_free_raster(rast); } -static void test_band_pixtype_1BB() { +static void test_band_pixtype_1BB(void) { rt_pixtype pixtype = PT_1BB; uint8_t *data = NULL; rt_band band = NULL; @@ -221,7 +221,7 @@ static void test_band_pixtype_1BB() { rt_band_destroy(band); } -static void test_band_pixtype_2BUI() { +static void test_band_pixtype_2BUI(void) { rt_pixtype pixtype = PT_2BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -313,7 +313,7 @@ static void test_band_pixtype_2BUI() { rt_band_destroy(band); } -static void test_band_pixtype_4BUI() { +static void test_band_pixtype_4BUI(void) { rt_pixtype pixtype = PT_4BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -419,7 +419,7 @@ static void test_band_pixtype_4BUI() { rt_band_destroy(band); } -static void test_band_pixtype_8BUI() { +static void test_band_pixtype_8BUI(void) { rt_pixtype pixtype = PT_8BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -527,7 +527,7 @@ static void test_band_pixtype_8BUI() { rt_band_destroy(band); } -static void test_band_pixtype_8BSI() { +static void test_band_pixtype_8BSI(void) { rt_pixtype pixtype = PT_8BSI; uint8_t *data = NULL; rt_band band = NULL; @@ -659,7 +659,7 @@ static void test_band_pixtype_8BSI() { rt_band_destroy(band); } -static void test_band_pixtype_16BUI() { +static void test_band_pixtype_16BUI(void) { rt_pixtype pixtype = PT_16BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -748,7 +748,7 @@ static void test_band_pixtype_16BUI() { rt_band_destroy(band); } -static void test_band_pixtype_16BSI() { +static void test_band_pixtype_16BSI(void) { rt_pixtype pixtype = PT_16BSI; uint8_t *data = NULL; rt_band band = NULL; @@ -860,7 +860,7 @@ static void test_band_pixtype_16BSI() { rt_band_destroy(band); } -static void test_band_pixtype_32BUI() { +static void test_band_pixtype_32BUI(void) { rt_pixtype pixtype = PT_32BUI; uint8_t *data = NULL; rt_band band = NULL; @@ -956,7 +956,7 @@ static void test_band_pixtype_32BUI() { rt_band_destroy(band); } -static void test_band_pixtype_32BSI() { +static void test_band_pixtype_32BSI(void) { rt_pixtype pixtype = PT_32BSI; uint8_t *data = NULL; rt_band band = NULL; @@ -1053,7 +1053,7 @@ static void test_band_pixtype_32BSI() { rt_band_destroy(band); } -static void test_band_pixtype_32BF() { +static void test_band_pixtype_32BF(void) { rt_pixtype pixtype = PT_32BF; uint8_t *data = NULL; rt_band band = NULL; @@ -1135,7 +1135,7 @@ static void test_band_pixtype_32BF() { rt_band_destroy(band); } -static void test_band_pixtype_64BF() { +static void test_band_pixtype_64BF(void) { rt_pixtype pixtype = PT_64BF; uint8_t *data = NULL; rt_band band = NULL; @@ -1217,7 +1217,7 @@ static void test_band_pixtype_64BF() { rt_band_destroy(band); } -static void test_band_get_pixel_line() { +static void test_band_get_pixel_line(void) { rt_raster rast; rt_band band; int maxX = 5; @@ -1259,7 +1259,7 @@ static void test_band_get_pixel_line() { cu_free_raster(rast); } -static void test_band_new_offline_from_path() { +static void test_band_new_offline_from_path(void) { rt_band band = NULL; int width = 10; int height = 10; diff --git a/raster/test/cunit/cu_band_misc.c b/raster/test/cunit/cu_band_misc.c index 0e1686564..f3af3f0a4 100644 --- a/raster/test/cunit/cu_band_misc.c +++ b/raster/test/cunit/cu_band_misc.c @@ -25,7 +25,7 @@ #include "cu_tester.h" #include -static void test_band_get_nearest_pixel() { +static void test_band_get_nearest_pixel(void) { rt_raster rast; rt_band band; int x, y; @@ -287,7 +287,7 @@ static void test_band_get_nearest_pixel() { cu_free_raster(rast); } -static void test_band_get_pixel_of_value() { +static void test_band_get_pixel_of_value(void) { rt_raster rast; rt_band band; uint32_t x, y; @@ -367,7 +367,7 @@ static void test_band_get_pixel_of_value() { cu_free_raster(rast); } -static void test_pixel_set_to_array(){ +static void test_pixel_set_to_array(void){ rt_raster rast; rt_band band; rt_mask mask = NULL; diff --git a/raster/test/cunit/cu_gdal.c b/raster/test/cunit/cu_gdal.c index 421bf93f3..3358e0b48 100644 --- a/raster/test/cunit/cu_gdal.c +++ b/raster/test/cunit/cu_gdal.c @@ -24,11 +24,11 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_gdal_configured() { +static void test_gdal_configured(void) { CU_ASSERT(rt_util_gdal_configured()); } -static void test_gdal_drivers() { +static void test_gdal_drivers(void) { uint32_t i; uint32_t size; rt_gdaldriver drv = NULL; @@ -46,7 +46,7 @@ static void test_gdal_drivers() { rtdealloc(drv); } -static void test_gdal_rasterize() { +static void test_gdal_rasterize(void) { rt_raster raster; char srs[] = "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-100],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"2163\"]]"; const char wkb_hex[] = "010300000001000000050000000000000080841ec100000000600122410000000080841ec100000000804f22410000000040e81dc100000000804f22410000000040e81dc100000000600122410000000080841ec10000000060012241"; @@ -151,7 +151,7 @@ static rt_raster fillRasterToPolygonize(int hasnodata, double nodataval) { return raster; } -static void test_gdal_polygonize() { +static void test_gdal_polygonize(void) { int i; rt_raster rt; int nPols = 0; @@ -277,7 +277,7 @@ static void test_gdal_polygonize() { cu_free_raster(rt); } -static void test_raster_to_gdal() { +static void test_raster_to_gdal(void) { rt_pixtype pixtype = PT_64BF; rt_raster raster = NULL; rt_band band = NULL; @@ -350,7 +350,7 @@ static void test_raster_to_gdal() { cu_free_raster(raster); } -static void test_gdal_to_raster() { +static void test_gdal_to_raster(void) { rt_pixtype pixtype = PT_64BF; rt_band band = NULL; @@ -473,7 +473,7 @@ static void test_gdal_to_raster() { cu_free_raster(raster); } -static void test_gdal_warp() { +static void test_gdal_warp(void) { rt_pixtype pixtype = PT_64BF; rt_band band = NULL; diff --git a/raster/test/cunit/cu_mapalgebra.c b/raster/test/cunit/cu_mapalgebra.c index 32e9e6e04..553cc7c36 100644 --- a/raster/test/cunit/cu_mapalgebra.c +++ b/raster/test/cunit/cu_mapalgebra.c @@ -492,7 +492,7 @@ static int testRasterIterator7_callback(rt_iterator_arg arg, void *userarg, doub return 1; } -static void test_raster_iterator() { +static void test_raster_iterator(void) { rt_raster rast1; rt_raster rast2; rt_raster rast3; @@ -793,7 +793,7 @@ static void test_raster_iterator() { if (rtn != NULL) cu_free_raster(rtn); } -static void test_band_reclass() { +static void test_band_reclass(void) { rt_reclassexpr *exprset; rt_raster raster; @@ -879,7 +879,7 @@ static void test_band_reclass() { rt_band_destroy(newband); } -static void test_raster_colormap() { +static void test_raster_colormap(void) { rt_raster raster; rt_raster rtn; rt_band band; diff --git a/raster/test/cunit/cu_misc.c b/raster/test/cunit/cu_misc.c index 24c618dbd..791d70136 100644 --- a/raster/test/cunit/cu_misc.c +++ b/raster/test/cunit/cu_misc.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_rgb_to_hsv() { +static void test_rgb_to_hsv(void) { double rgb[3] = {0, 0, 0}; double hsv[3] = {0, 0, 0}; @@ -66,7 +66,7 @@ static void test_rgb_to_hsv() { CU_ASSERT_DOUBLE_EQUAL(hsv[2], 0.4, DBL_EPSILON); } -static void test_hsv_to_rgb() { +static void test_hsv_to_rgb(void) { double hsv[3] = {0, 0, 0}; double rgb[3] = {0, 0, 0}; @@ -108,7 +108,7 @@ static void test_hsv_to_rgb() { CU_ASSERT_DOUBLE_EQUAL(rgb[2], 0.4, DBL_EPSILON); } -static void test_util_gdal_open() { +static void test_util_gdal_open(void) { extern char *gdal_enabled_drivers; GDALDatasetH ds; diff --git a/raster/test/cunit/cu_pixtype.c b/raster/test/cunit/cu_pixtype.c index 45333a35e..5ac1afef3 100644 --- a/raster/test/cunit/cu_pixtype.c +++ b/raster/test/cunit/cu_pixtype.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_pixtype_size() { +static void test_pixtype_size(void) { CU_ASSERT_EQUAL(rt_pixtype_size(PT_1BB), 1); CU_ASSERT_EQUAL(rt_pixtype_size(PT_2BUI), 1); CU_ASSERT_EQUAL(rt_pixtype_size(PT_4BUI), 1); @@ -40,11 +40,11 @@ static void test_pixtype_size() { CU_ASSERT_EQUAL(rt_pixtype_size(PT_END), -1); } -static void test_pixtype_alignment() { +static void test_pixtype_alignment(void) { /* rt_pixtype_alignment() just forwards to rt_pixtype_size() */ } -static void test_pixtype_name() { +static void test_pixtype_name(void) { CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_1BB), "1BB"); CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_2BUI), "2BUI"); CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_4BUI), "4BUI"); @@ -60,7 +60,7 @@ static void test_pixtype_name() { CU_ASSERT_STRING_EQUAL(rt_pixtype_name(PT_END), "Unknown"); } -static void test_pixtype_index_from_name() { +static void test_pixtype_index_from_name(void) { CU_ASSERT_EQUAL(rt_pixtype_index_from_name("1BB"), PT_1BB); CU_ASSERT_EQUAL(rt_pixtype_index_from_name("2BUI"), PT_2BUI); CU_ASSERT_EQUAL(rt_pixtype_index_from_name("4BUI"), PT_4BUI); @@ -79,7 +79,7 @@ static void test_pixtype_index_from_name() { CU_ASSERT_EQUAL(rt_pixtype_index_from_name("3BUI"), PT_END); } -static void test_pixtype_get_min_value() { +static void test_pixtype_get_min_value(void) { CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_1BB), rt_util_clamp_to_1BB((double) CHAR_MIN), DBL_EPSILON); CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_2BUI), rt_util_clamp_to_2BUI((double) CHAR_MIN), DBL_EPSILON); CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_4BUI), rt_util_clamp_to_4BUI((double) CHAR_MIN), DBL_EPSILON); @@ -95,7 +95,7 @@ static void test_pixtype_get_min_value() { CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_END), rt_util_clamp_to_8BUI((double) CHAR_MIN), DBL_EPSILON); } -static void test_pixtype_compare_clamped_values() { +static void test_pixtype_compare_clamped_values(void) { int isequal = 0; /* 1BB */ diff --git a/raster/test/cunit/cu_raster_basics.c b/raster/test/cunit/cu_raster_basics.c index 98d640a1a..ad68cba9d 100644 --- a/raster/test/cunit/cu_raster_basics.c +++ b/raster/test/cunit/cu_raster_basics.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_new() { +static void test_raster_new(void) { rt_raster raster = NULL; raster = rt_raster_new(0, 0); @@ -40,7 +40,7 @@ static void test_raster_new() { cu_free_raster(raster); } -static void test_raster_empty() { +static void test_raster_empty(void) { rt_raster raster = NULL; /* check that raster is empty */ @@ -59,7 +59,7 @@ static void test_raster_empty() { cu_free_raster(raster); } -static void test_raster_metadata() { +static void test_raster_metadata(void) { rt_raster raster = NULL; /* create raster */ @@ -96,7 +96,7 @@ static void test_raster_metadata() { cu_free_raster(raster); } -static void test_raster_clone() { +static void test_raster_clone(void) { rt_raster rast1; rt_raster rast2; rt_band band; @@ -140,7 +140,7 @@ static void test_raster_clone() { cu_free_raster(rast1); } -static void test_raster_from_band() { +static void test_raster_from_band(void) { uint32_t bandNums[] = {1,3}; int lenBandNums = 2; rt_raster raster; @@ -169,7 +169,7 @@ static void test_raster_from_band() { cu_free_raster(raster); } -static void test_raster_replace_band() { +static void test_raster_replace_band(void) { rt_raster raster; rt_band band; rt_band rband; diff --git a/raster/test/cunit/cu_raster_geometry.c b/raster/test/cunit/cu_raster_geometry.c index 162e44789..97ebb40f4 100644 --- a/raster/test/cunit/cu_raster_geometry.c +++ b/raster/test/cunit/cu_raster_geometry.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_envelope() { +static void test_raster_envelope(void) { rt_raster raster = NULL; rt_envelope rtenv; @@ -85,7 +85,7 @@ static void test_raster_envelope() { cu_free_raster(raster); } -static void test_raster_envelope_geom() { +static void test_raster_envelope_geom(void) { rt_raster raster = NULL; LWGEOM *env = NULL; LWPOLY *poly = NULL; @@ -163,7 +163,7 @@ static void test_raster_envelope_geom() { cu_free_raster(raster); } -static void test_raster_convex_hull() { +static void test_raster_convex_hull(void) { rt_raster raster = NULL; LWGEOM *hull = NULL; LWPOLY *poly = NULL; @@ -252,7 +252,7 @@ lwgeom_to_text(const LWGEOM *lwgeom) { return wkt; } -static void test_raster_surface() { +static void test_raster_surface(void) { rt_raster rast; rt_band band; const int maxX = 5; @@ -374,7 +374,7 @@ static void test_raster_surface() { cu_free_raster(rast); } -static void test_raster_perimeter() { +static void test_raster_perimeter(void) { rt_raster rast; rt_band band; const int maxX = 5; @@ -528,7 +528,7 @@ static void test_raster_perimeter() { cu_free_raster(rast); } -static void test_raster_pixel_as_polygon() { +static void test_raster_pixel_as_polygon(void) { rt_raster rast; rt_band band; uint32_t x, y; @@ -576,7 +576,7 @@ static void test_raster_pixel_as_polygon() { -static void test_raster_get_pixel_bilinear() { +static void test_raster_get_pixel_bilinear(void) { uint32_t width = 2; uint32_t height = 2; double ul_x = 0.0; diff --git a/raster/test/cunit/cu_raster_misc.c b/raster/test/cunit/cu_raster_misc.c index b2ed95e17..90888a9aa 100644 --- a/raster/test/cunit/cu_raster_misc.c +++ b/raster/test/cunit/cu_raster_misc.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_cell_to_geopoint() { +static void test_raster_cell_to_geopoint(void) { rt_raster raster; int rtn; double xw, yw; @@ -43,7 +43,7 @@ static void test_raster_cell_to_geopoint() { cu_free_raster(raster); } -static void test_raster_geopoint_to_cell() { +static void test_raster_geopoint_to_cell(void) { rt_raster raster; int rtn; double xr, yr; @@ -62,7 +62,7 @@ static void test_raster_geopoint_to_cell() { cu_free_raster(raster); } -static void test_raster_from_two_rasters() { +static void test_raster_from_two_rasters(void) { rt_raster rast1; rt_raster rast2; rt_raster rast = NULL; @@ -175,7 +175,7 @@ static void test_raster_from_two_rasters() { cu_free_raster(rast1); } -static void test_raster_compute_skewed_raster() { +static void test_raster_compute_skewed_raster(void) { rt_envelope extent; rt_raster rast; double skew[2] = {0.25, 0.25}; diff --git a/raster/test/cunit/cu_raster_wkb.c b/raster/test/cunit/cu_raster_wkb.c index fd36aa6f9..e1e6219e1 100644 --- a/raster/test/cunit/cu_raster_wkb.c +++ b/raster/test/cunit/cu_raster_wkb.c @@ -25,7 +25,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_wkb() { +static void test_raster_wkb(void) { /* will use default allocators and message handlers */ rt_raster raster = NULL; const char *hexwkb = NULL; diff --git a/raster/test/cunit/cu_spatial_relationship.c b/raster/test/cunit/cu_spatial_relationship.c index f99e78b01..7438367e4 100644 --- a/raster/test/cunit/cu_spatial_relationship.c +++ b/raster/test/cunit/cu_spatial_relationship.c @@ -24,7 +24,7 @@ #include "CUnit/Basic.h" #include "cu_tester.h" -static void test_raster_geos_overlaps() { +static void test_raster_geos_overlaps(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -499,7 +499,7 @@ static void test_raster_geos_overlaps() { cu_free_raster(rast1); } -static void test_raster_geos_touches() { +static void test_raster_geos_touches(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -1026,7 +1026,7 @@ static void test_raster_geos_touches() { cu_free_raster(rast1); } -static void test_raster_geos_contains() { +static void test_raster_geos_contains(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -1553,7 +1553,7 @@ static void test_raster_geos_contains() { cu_free_raster(rast1); } -static void test_raster_geos_contains_properly() { +static void test_raster_geos_contains_properly(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -2080,7 +2080,7 @@ static void test_raster_geos_contains_properly() { cu_free_raster(rast1); } -static void test_raster_geos_covers() { +static void test_raster_geos_covers(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -2607,7 +2607,7 @@ static void test_raster_geos_covers() { cu_free_raster(rast1); } -static void test_raster_geos_covered_by() { +static void test_raster_geos_covered_by(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -3134,7 +3134,7 @@ static void test_raster_geos_covered_by() { cu_free_raster(rast1); } -static void test_raster_within_distance() { +static void test_raster_within_distance(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -3696,7 +3696,7 @@ static void test_raster_within_distance() { cu_free_raster(rast1); } -static void test_raster_fully_within_distance() { +static void test_raster_fully_within_distance(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -4258,7 +4258,7 @@ static void test_raster_fully_within_distance() { cu_free_raster(rast1); } -static void test_raster_intersects() { +static void test_raster_intersects(void) { rt_raster rast1; rt_raster rast2; rt_band band1; @@ -4725,7 +4725,7 @@ static void test_raster_intersects() { cu_free_raster(rast1); } -static void test_raster_same_alignment() { +static void test_raster_same_alignment(void) { rt_raster rast1; rt_raster rast2; int rtn; commit 44ac9bc46984fd649ebdc9076aecd0e678136314 Author: Paul Ramsey Date: Fri Apr 10 16:33:36 2026 -0700 Remove potential null dereference in ptarray_calc_areas() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index 6efeb0eb5..a16dfce1c 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -358,6 +358,9 @@ void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, do const double *P2; const double *P3; + if (npoints < 2) + lwerror("%s: not enough points provided", __func__); + P1 = (double*)getPoint_internal(ea->inpts, 0); P2 = (double*)getPoint_internal(ea->inpts, 1); commit 16d388906c641f702d5e5c669f311e59103ed216 Author: Paul Ramsey Date: Fri Apr 10 16:33:16 2026 -0700 Remove potential null dereference in lwcircstring_linearize() diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c index 3adfeb055..5bea73a24 100644 --- a/liblwgeom/lwstroke.c +++ b/liblwgeom/lwstroke.c @@ -565,8 +565,11 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, return NULL; } } - getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); - ptarray_append_point(ptarray, &p1, LW_FALSE); + if (icurve->points->npoints > 0) + { + getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); + ptarray_append_point(ptarray, &p1, LW_FALSE); + } oline = lwline_construct(icurve->srid, NULL, ptarray); return oline; commit 7372f89acd938ff9c6f46d2822b34b4089d5d07c Author: Paul Ramsey Date: Fri Apr 10 15:55:18 2026 -0700 Remove potential null dereference in pt_in_ring_3d() diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 57b29ffe2..bc3e6d063 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -1579,6 +1579,9 @@ pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane) POINT3DZ first, last; + if ( !ring || ring->npoints == 0 ) + lwerror("%s called on empty pointarray", __func__); + getPoint3dz_p(ring, 0, &first); getPoint3dz_p(ring, ring->npoints - 1, &last); if (memcmp(&first, &last, sizeof(POINT3DZ))) commit af79a7a0cb8d5e9219f4c3bfcca64fbc0b927eb0 Author: Paul Ramsey Date: Fri Apr 10 15:36:05 2026 -0700 Remove potential null dereference from ptarray_contains_point_partial() diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 2afb12c44..de8944089 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1042,10 +1042,13 @@ ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int chec const POINT2D *seg1, *seg2; double ymin, ymax; + if ( !pa || !pa->npoints ) + lwerror("%s called on empty pointarray", __func__); + seg1 = getPoint2d_cp(pa, 0); seg2 = getPoint2d_cp(pa, pa->npoints-1); if ( check_closed && ! p2d_same(seg1, seg2) ) - lwerror("ptarray_contains_point called on unclosed ring"); + lwerror("%s called on unclosed ring", __func__); for ( i=1; i < pa->npoints; i++ ) { commit 72c3a7a5e7006c228e796324087be3c117793ea1 Author: Paul Ramsey Date: Fri Apr 10 15:31:16 2026 -0700 Remove unused function pt_in_ring_2d() diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 54eb1e7ed..391c383aa 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1365,7 +1365,6 @@ extern uint32_t lwcompound_num_curves(const LWCOMPOUND *compound); extern const LWGEOM *lwcollection_getsubcurve(const LWCOMPOUND *compound, uint32_t gnum); extern double ptarray_length_2d(const POINTARRAY *pts); -extern int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); extern int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret); extern LWPOINT* lwpoint_project_lwpoint(const LWPOINT* lwpoint1, const LWPOINT* lwpoint2, double distance); extern LWPOINT* lwpoint_project(const LWPOINT* lwpoint1, double distance, double azimuth); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 04a3504e2..610807120 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -448,7 +448,6 @@ int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); int lw_pt_on_segment(const POINT2D* p1, const POINT2D* p2, const POINT2D* p); double lw_seg_length(const POINT2D *A1, const POINT2D *A2); double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); -int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number); diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 9f9e42503..92a16d335 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -293,62 +293,6 @@ lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D * return cr; } -int -pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring) -{ - int cn = 0; /* the crossing number counter */ - uint32_t i; - const POINT2D *v1, *v2; - const POINT2D *first, *last; - - first = getPoint2d_cp(ring, 0); - last = getPoint2d_cp(ring, ring->npoints-1); - if ( memcmp(first, last, sizeof(POINT2D)) ) - { - lwerror("pt_in_ring_2d: V[n] != V[0] (%g %g != %g %g)", - first->x, first->y, last->x, last->y); - return LW_FALSE; - - } - - LWDEBUGF(2, "pt_in_ring_2d called with point: %g %g", p->x, p->y); - /* printPA(ring); */ - - /* loop through all edges of the polygon */ - v1 = getPoint2d_cp(ring, 0); - for (i=0; inpoints-1; i++) - { - double vt; - v2 = getPoint2d_cp(ring, i+1); - - /* edge from vertex i to vertex i+1 */ - if - ( - /* an upward crossing */ - ((v1->y <= p->y) && (v2->y > p->y)) - /* a downward crossing */ - || ((v1->y > p->y) && (v2->y <= p->y)) - ) - { - - vt = (double)(p->y - v1->y) / (v2->y - v1->y); - - /* P->x x < v1->x + vt * (v2->x - v1->x)) - { - /* a valid crossing of y=p->y right of p->x */ - ++cn; - } - } - v1 = v2; - } - - LWDEBUGF(3, "pt_in_ring_2d returning %d", cn&1); - - return (cn&1); /* 0 if even (out), and 1 if odd (in) */ -} - - static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2) { commit 4c85dfa2c69fcdc12cd428f033529301908ca251 Author: Paul Ramsey Date: Fri Apr 10 15:29:19 2026 -0700 Remove reported crash in lwcompound_add_lwgeom() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 770acdc6b..f33b0f729 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -168,6 +168,9 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom) /* Last point of the previous component */ LWLINE *prevline = (LWLINE*)(col->geoms[col->ngeoms-1]); + if (lwline_is_empty(prevline)) + return LW_FAILURE; + getPoint4d_p(newline->points, 0, &first); getPoint4d_p(prevline->points, prevline->points->npoints-1, &last); commit 75254c60697241cd8a8804bbc37feb9a0a1890f1 Author: Paul Ramsey Date: Fri Apr 10 14:56:21 2026 -0700 Remove reported crash in lwcompound_is_closed() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 1e0d5c2ee..770acdc6b 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -47,31 +47,40 @@ lwcollection_getsubcurve(const LWCOMPOUND *compound, uint32_t curvenum) int lwcompound_is_closed(const LWCOMPOUND *compound) { + const LWLINE *line_start, *line_end; + const POINTARRAY *pa_start, *pa_end; + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) return LW_FALSE; - for (uint32_t i = 0; i < compound->ngeoms; i++) + /* Single entry, closes on itself */ + if (compound->ngeoms == 1 && lwline_is_closed((LWLINE *)(compound->geoms[0]))) + return LW_TRUE; + + /* If internal connectivity is lacking, so is closure */ + if (!lwcompound_is_valid(compound)) + return LW_FALSE; + + /* Internal connection is good, what about start/end points? */ + line_start = (LWLINE *)(compound->geoms[0]); + line_end = (LWLINE *)(compound->geoms[compound->ngeoms-1]); + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) { - uint32_t i_end = i == 0 ? compound->ngeoms - 1 : i - 1; - const LWLINE *geom_start = (LWLINE *)(compound->geoms[i]); - const LWLINE *geom_end = (LWLINE *)(compound->geoms[i_end]); - const POINTARRAY *pa_start = geom_start->points; - const POINTARRAY *pa_end = geom_end->points; - if (hasz) - { - const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); - const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); - if (!p3d_same(pt_start, pt_end)) - return LW_FALSE; - } - else - { - const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); - const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); - if (!p2d_same(pt_start, pt_end)) - return LW_FALSE; - } + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; } return LW_TRUE; @@ -84,12 +93,24 @@ lwcompound_is_valid(const LWCOMPOUND *compound) if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) return LW_TRUE; + /* Only one component, do not need to test connectivity */ + if (compound->ngeoms == 1) + return LW_TRUE; + + /* Check internal connectivity between components */ for (uint32_t i = 1; i < compound->ngeoms; i++) { - const LWLINE *geom_start = (LWLINE *)(compound->geoms[i]); - const LWLINE *geom_end = (LWLINE *)(compound->geoms[i-1]); - const POINTARRAY *pa_start = geom_start->points; - const POINTARRAY *pa_end = geom_end->points; + const POINTARRAY *pa_start, *pa_end; + const LWLINE *line_start = (LWLINE *)(compound->geoms[i]); + const LWLINE *line_end = (LWLINE *)(compound->geoms[i-1]); + + /* Empty cannot be a compound component, because it joins nothing */ + if (lwline_is_empty(line_start) || (lwline_is_empty(line_end))) + return LW_FALSE; + + pa_start = line_start->points; + pa_end = line_end->points; + if (hasz) { const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); commit fa01f2bdc0b17b84000198df12b44ac4ed6dd1da Author: Paul Ramsey Date: Fri Apr 10 13:56:41 2026 -0700 Remove reported crash in lwline_set_effective_area() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index f0f67c2ea..6efeb0eb5 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -464,7 +464,8 @@ static LWLINE* lwline_set_effective_area(const LWLINE *iline,int set_area, doubl LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m); - + if (iline->points->npoints < 2) + return oline; oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld)); @@ -491,7 +492,12 @@ static LWPOLY* lwpoly_set_effective_area(const LWPOLY *ipoly,int set_area, doubl for (i = 0; i < ipoly->nrings; i++) { - POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); + POINTARRAY *pa; + + if (ipoly->rings[i]->npoints < 4) + continue; + + pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); /* Add ring to simplified polygon */ if(pa->npoints>=4) { ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + deps/uthash/include/uthash.h | 39 ++++++++---- deps/wagyu/lwgeom_wagyu.cpp | 6 +- deps/wagyu/lwgeom_wagyu.h | 6 +- extensions/address_standardizer/khash.h | 4 +- extensions/address_standardizer/parseaddress-api.c | 2 +- extensions/address_standardizer/standard.c | 2 +- liblwgeom/cunit/cu_ptarray.c | 14 ++--- .../cunit/cu_remove_irrelevant_points_for_view.c | 2 +- liblwgeom/cunit/cu_tester.c | 12 ++-- liblwgeom/effectivearea.c | 13 +++- liblwgeom/liblwgeom.h.in | 1 - liblwgeom/liblwgeom_internal.h | 16 ++++- liblwgeom/lwalgorithm.c | 56 ----------------- liblwgeom/lwboundingcircle.c | 4 +- liblwgeom/lwcompound.c | 72 ++++++++++++++-------- liblwgeom/lwgeom_api.c | 6 +- liblwgeom/lwstroke.c | 7 ++- liblwgeom/measures3d.c | 3 + liblwgeom/ptarray.c | 5 +- libpgcommon/lwgeom_transform.c | 2 +- libpgcommon/lwgeom_transform.h | 2 +- loader/cunit/cu_tester.c | 2 +- postgis/gserialized_typmod.c | 1 + postgis/lwgeom_functions_basic.c | 4 +- postgis/lwgeom_geos_prepared.c | 2 +- postgis/lwgeom_transform.c | 2 +- postgis/postgis_module.c | 4 +- raster/rt_pg/rtpg_mapalgebra.c | 3 +- raster/rt_pg/rtpg_pixel.c | 4 +- raster/rt_pg/rtpg_statistics.c | 2 +- raster/test/cunit/cu_band_basics.c | 28 ++++----- raster/test/cunit/cu_band_misc.c | 6 +- raster/test/cunit/cu_gdal.c | 14 ++--- raster/test/cunit/cu_mapalgebra.c | 6 +- raster/test/cunit/cu_misc.c | 6 +- raster/test/cunit/cu_pixtype.c | 12 ++-- raster/test/cunit/cu_raster_basics.c | 12 ++-- raster/test/cunit/cu_raster_geometry.c | 14 ++--- raster/test/cunit/cu_raster_misc.c | 8 +-- raster/test/cunit/cu_raster_wkb.c | 2 +- raster/test/cunit/cu_spatial_relationship.c | 20 +++--- 42 files changed, 223 insertions(+), 204 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Apr 13 11:12:25 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 18:12:25 -0000 Subject: [PostGIS] #6069: Build failure on 3.6 CI latest In-Reply-To: <049.c96cd0e773dde3738abf7b88a13aab0f@osgeo.org> References: <049.c96cd0e773dde3738abf7b88a13aab0f@osgeo.org> Message-ID: <064.d50e257124034ffa935455b11799b62a@osgeo.org> #6069: Build failure on 3.6 CI latest ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: | Keywords: ----------------------+--------------------------- Comment (by Paul Ramsey ): In [changeset:"f02a7536cb3597d2db400fdd0e4747f03e29b6e2/git" f02a753/git]: {{{#!CommitTicketReference repository="git" revision="f02a7536cb3597d2db400fdd0e4747f03e29b6e2" Catch all FALLTHROUGH cases in a standard way, move to strict K&R style prototypes for functions with no arguments, cleans up warnings in recent compilers References #6069 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 13 11:19:31 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 18:19:31 -0000 Subject: [PostGIS] #6069: Build failure on 3.6 CI latest In-Reply-To: <049.c96cd0e773dde3738abf7b88a13aab0f@osgeo.org> References: <049.c96cd0e773dde3738abf7b88a13aab0f@osgeo.org> Message-ID: <064.6483b8fbc3617a1d62cf326e0e0db1ad@osgeo.org> #6069: Build failure on 3.6 CI latest ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------+--------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Apr 13 11:44:00 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 11:44:00 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-450-gd4f15e43a Message-ID: <20260413184400.56BAA18C010@trac.osgeo.org> 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 d4f15e43ae5602910bd05e65685022d485063e73 (commit) via 9f1c511313354c07cb935830c727119a9ff62204 (commit) via 23c502b0b5799833d644341036ada1ee01e83654 (commit) via f3d2c94a735c3b8bad66b12c22b65cda09c737f9 (commit) via 5df3844230e224aca1aa46cdf0ef34334ad4f9a4 (commit) via 910963ad286a9fe07bb926d6832f33f40d29e741 (commit) via 0fce8d9bd0ef93eb9965991d41e4b9d1a5fc3629 (commit) via a3641359a7663c48b46957b79632706777c30b86 (commit) from dca869b309a2d7fda9fd1c173a326540af9f34d8 (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 d4f15e43ae5602910bd05e65685022d485063e73 Author: Paul Ramsey Date: Fri Apr 10 16:33:36 2026 -0700 Remove potential null dereference in ptarray_calc_areas() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index 6efeb0eb5..a16dfce1c 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -358,6 +358,9 @@ void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, do const double *P2; const double *P3; + if (npoints < 2) + lwerror("%s: not enough points provided", __func__); + P1 = (double*)getPoint_internal(ea->inpts, 0); P2 = (double*)getPoint_internal(ea->inpts, 1); commit 9f1c511313354c07cb935830c727119a9ff62204 Author: Paul Ramsey Date: Fri Apr 10 16:33:16 2026 -0700 Remove potential null dereference in lwcircstring_linearize() diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c index 3adfeb055..5bea73a24 100644 --- a/liblwgeom/lwstroke.c +++ b/liblwgeom/lwstroke.c @@ -565,8 +565,11 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, return NULL; } } - getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); - ptarray_append_point(ptarray, &p1, LW_FALSE); + if (icurve->points->npoints > 0) + { + getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); + ptarray_append_point(ptarray, &p1, LW_FALSE); + } oline = lwline_construct(icurve->srid, NULL, ptarray); return oline; commit 23c502b0b5799833d644341036ada1ee01e83654 Author: Paul Ramsey Date: Fri Apr 10 15:55:18 2026 -0700 Remove potential null dereference in pt_in_ring_3d() diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 57b29ffe2..bc3e6d063 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -1579,6 +1579,9 @@ pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane) POINT3DZ first, last; + if ( !ring || ring->npoints == 0 ) + lwerror("%s called on empty pointarray", __func__); + getPoint3dz_p(ring, 0, &first); getPoint3dz_p(ring, ring->npoints - 1, &last); if (memcmp(&first, &last, sizeof(POINT3DZ))) commit f3d2c94a735c3b8bad66b12c22b65cda09c737f9 Author: Paul Ramsey Date: Fri Apr 10 15:36:05 2026 -0700 Remove potential null dereference from ptarray_contains_point_partial() diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index df5782adb..65b72290b 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -971,10 +971,13 @@ ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int chec const POINT2D *seg1, *seg2; double ymin, ymax; + if ( !pa || !pa->npoints ) + lwerror("%s called on empty pointarray", __func__); + seg1 = getPoint2d_cp(pa, 0); seg2 = getPoint2d_cp(pa, pa->npoints-1); if ( check_closed && ! p2d_same(seg1, seg2) ) - lwerror("ptarray_contains_point called on unclosed ring"); + lwerror("%s called on unclosed ring", __func__); for ( i=1; i < pa->npoints; i++ ) { commit 5df3844230e224aca1aa46cdf0ef34334ad4f9a4 Author: Paul Ramsey Date: Fri Apr 10 15:31:16 2026 -0700 Remove unused function pt_in_ring_2d() diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index b9081db9c..9ff00e1a4 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1365,7 +1365,6 @@ extern uint32_t lwcompound_num_curves(const LWCOMPOUND *compound); extern const LWGEOM *lwcollection_getsubcurve(const LWCOMPOUND *compound, uint32_t gnum); extern double ptarray_length_2d(const POINTARRAY *pts); -extern int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); extern int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret); extern LWPOINT* lwpoint_project_lwpoint(const LWPOINT* lwpoint1, const LWPOINT* lwpoint2, double distance); extern LWPOINT* lwpoint_project(const LWPOINT* lwpoint1, double distance, double azimuth); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 828c81eeb..a8b28b503 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -471,7 +471,6 @@ int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); int lw_pt_on_segment(const POINT2D* p1, const POINT2D* p2, const POINT2D* p); double lw_seg_length(const POINT2D *A1, const POINT2D *A2); double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); -int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number); diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 2ddc721da..75d8b3549 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -293,62 +293,6 @@ lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D * return cr; } -int -pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring) -{ - int cn = 0; /* the crossing number counter */ - uint32_t i; - const POINT2D *v1, *v2; - const POINT2D *first, *last; - - first = getPoint2d_cp(ring, 0); - last = getPoint2d_cp(ring, ring->npoints-1); - if ( memcmp(first, last, sizeof(POINT2D)) ) - { - lwerror("pt_in_ring_2d: V[n] != V[0] (%g %g != %g %g)", - first->x, first->y, last->x, last->y); - return LW_FALSE; - - } - - LWDEBUGF(2, "pt_in_ring_2d called with point: %g %g", p->x, p->y); - /* printPA(ring); */ - - /* loop through all edges of the polygon */ - v1 = getPoint2d_cp(ring, 0); - for (i=0; inpoints-1; i++) - { - double vt; - v2 = getPoint2d_cp(ring, i+1); - - /* edge from vertex i to vertex i+1 */ - if - ( - /* an upward crossing */ - ((v1->y <= p->y) && (v2->y > p->y)) - /* a downward crossing */ - || ((v1->y > p->y) && (v2->y <= p->y)) - ) - { - - vt = (double)(p->y - v1->y) / (v2->y - v1->y); - - /* P->x x < v1->x + vt * (v2->x - v1->x)) - { - /* a valid crossing of y=p->y right of p->x */ - ++cn; - } - } - v1 = v2; - } - - LWDEBUGF(3, "pt_in_ring_2d returning %d", cn&1); - - return (cn&1); /* 0 if even (out), and 1 if odd (in) */ -} - - static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2) { commit 910963ad286a9fe07bb926d6832f33f40d29e741 Author: Paul Ramsey Date: Fri Apr 10 15:29:19 2026 -0700 Remove reported crash in lwcompound_add_lwgeom() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 770acdc6b..f33b0f729 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -168,6 +168,9 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom) /* Last point of the previous component */ LWLINE *prevline = (LWLINE*)(col->geoms[col->ngeoms-1]); + if (lwline_is_empty(prevline)) + return LW_FAILURE; + getPoint4d_p(newline->points, 0, &first); getPoint4d_p(prevline->points, prevline->points->npoints-1, &last); commit 0fce8d9bd0ef93eb9965991d41e4b9d1a5fc3629 Author: Paul Ramsey Date: Fri Apr 10 13:56:41 2026 -0700 Remove reported crash in lwline_set_effective_area() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index f0f67c2ea..6efeb0eb5 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -464,7 +464,8 @@ static LWLINE* lwline_set_effective_area(const LWLINE *iline,int set_area, doubl LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m); - + if (iline->points->npoints < 2) + return oline; oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld)); @@ -491,7 +492,12 @@ static LWPOLY* lwpoly_set_effective_area(const LWPOLY *ipoly,int set_area, doubl for (i = 0; i < ipoly->nrings; i++) { - POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); + POINTARRAY *pa; + + if (ipoly->rings[i]->npoints < 4) + continue; + + pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); /* Add ring to simplified polygon */ if(pa->npoints>=4) { commit a3641359a7663c48b46957b79632706777c30b86 Author: Paul Ramsey Date: Fri Apr 10 14:56:21 2026 -0700 Remove reported crash in lwcompound_is_closed() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 1e0d5c2ee..770acdc6b 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -47,31 +47,40 @@ lwcollection_getsubcurve(const LWCOMPOUND *compound, uint32_t curvenum) int lwcompound_is_closed(const LWCOMPOUND *compound) { + const LWLINE *line_start, *line_end; + const POINTARRAY *pa_start, *pa_end; + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) return LW_FALSE; - for (uint32_t i = 0; i < compound->ngeoms; i++) + /* Single entry, closes on itself */ + if (compound->ngeoms == 1 && lwline_is_closed((LWLINE *)(compound->geoms[0]))) + return LW_TRUE; + + /* If internal connectivity is lacking, so is closure */ + if (!lwcompound_is_valid(compound)) + return LW_FALSE; + + /* Internal connection is good, what about start/end points? */ + line_start = (LWLINE *)(compound->geoms[0]); + line_end = (LWLINE *)(compound->geoms[compound->ngeoms-1]); + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) { - uint32_t i_end = i == 0 ? compound->ngeoms - 1 : i - 1; - const LWLINE *geom_start = (LWLINE *)(compound->geoms[i]); - const LWLINE *geom_end = (LWLINE *)(compound->geoms[i_end]); - const POINTARRAY *pa_start = geom_start->points; - const POINTARRAY *pa_end = geom_end->points; - if (hasz) - { - const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); - const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); - if (!p3d_same(pt_start, pt_end)) - return LW_FALSE; - } - else - { - const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); - const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); - if (!p2d_same(pt_start, pt_end)) - return LW_FALSE; - } + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; } return LW_TRUE; @@ -84,12 +93,24 @@ lwcompound_is_valid(const LWCOMPOUND *compound) if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) return LW_TRUE; + /* Only one component, do not need to test connectivity */ + if (compound->ngeoms == 1) + return LW_TRUE; + + /* Check internal connectivity between components */ for (uint32_t i = 1; i < compound->ngeoms; i++) { - const LWLINE *geom_start = (LWLINE *)(compound->geoms[i]); - const LWLINE *geom_end = (LWLINE *)(compound->geoms[i-1]); - const POINTARRAY *pa_start = geom_start->points; - const POINTARRAY *pa_end = geom_end->points; + const POINTARRAY *pa_start, *pa_end; + const LWLINE *line_start = (LWLINE *)(compound->geoms[i]); + const LWLINE *line_end = (LWLINE *)(compound->geoms[i-1]); + + /* Empty cannot be a compound component, because it joins nothing */ + if (lwline_is_empty(line_start) || (lwline_is_empty(line_end))) + return LW_FALSE; + + pa_start = line_start->points; + pa_end = line_end->points; + if (hasz) { const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); ----------------------------------------------------------------------- Summary of changes: liblwgeom/effectivearea.c | 13 ++++++-- liblwgeom/liblwgeom.h.in | 1 - liblwgeom/liblwgeom_internal.h | 1 - liblwgeom/lwalgorithm.c | 56 -------------------------------- liblwgeom/lwcompound.c | 72 ++++++++++++++++++++++++++++-------------- liblwgeom/lwstroke.c | 7 ++-- liblwgeom/measures3d.c | 3 ++ liblwgeom/ptarray.c | 5 ++- 8 files changed, 71 insertions(+), 87 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Apr 13 11:48:39 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 11:48:39 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-451-g67999e2b1 Message-ID: <20260413184840.1CEE318C47A@trac.osgeo.org> 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 67999e2b1d2683ea14785e00e77070a2ced9aa7d (commit) from d4f15e43ae5602910bd05e65685022d485063e73 (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 67999e2b1d2683ea14785e00e77070a2ced9aa7d Author: Paul Ramsey Date: Mon Apr 13 11:48:35 2026 -0700 Add regression tests for Curve handling cases with oddball inputs diff --git a/regress/core/curvetoline.sql b/regress/core/curvetoline.sql index 3fe30a78a..ac7e11792 100644 --- a/regress/core/curvetoline.sql +++ b/regress/core/curvetoline.sql @@ -60,3 +60,4 @@ SELECT 'multiarc1.maxerr20.sym', ST_AsText(ST_SnapToGrid(ST_CurveToLine( 1 -- Symmetric ), 2)); +SELECT 'ST_CurveToLine EMPTY', ST_CurveToLine('CIRCULARSTRING EMPTY'); diff --git a/regress/core/curvetoline_expected b/regress/core/curvetoline_expected index 115897e9b..937e6d492 100644 --- a/regress/core/curvetoline_expected +++ b/regress/core/curvetoline_expected @@ -6,3 +6,4 @@ semicircle3.sym|LINESTRING(0 0,20 -58,70 -96,130 -96,180 -58,200 0) semicircle3.sym.ret|LINESTRING(0 0,2 -18,36 -76,100 -100,164 -76,198 -18,200 0) multiarc1|LINESTRING(0 0,30 -70,100 -100,170 -70,200 0,258 142,400 200,542 142,600 0) multiarc1.maxerr20.sym|LINESTRING(0 0,50 -86,150 -86,200 0,258 142,400 200,542 142,600 0) +ST_CurveToLine EMPTY|010200000000000000 diff --git a/regress/core/sql-mm-compoundcurve.sql b/regress/core/sql-mm-compoundcurve.sql index 2c18afab0..b05b9fcb4 100644 --- a/regress/core/sql-mm-compoundcurve.sql +++ b/regress/core/sql-mm-compoundcurve.sql @@ -263,3 +263,7 @@ SELECT 'curve accessors 01', ST_GeometryType(ST_CurveN(geom,0)) as curven_0, ST_CurveN(ST_CurveN(geom,3), 1) as curven_3_curven_1 FROM f; + +SELECT 'ST_IsClosed', + ST_IsClosed('01090000000200000001020000000200000000000000000000000000000000000000000000000000f03f000000000000f03f010200000000000000'::geometry); + diff --git a/regress/core/sql-mm-compoundcurve_expected b/regress/core/sql-mm-compoundcurve_expected index 783f64650..eead7ab85 100644 --- a/regress/core/sql-mm-compoundcurve_expected +++ b/regress/core/sql-mm-compoundcurve_expected @@ -82,3 +82,4 @@ ERROR: geometry requires more points ERROR: geometry requires more points ERROR: geometry requires more points curve accessors 01|1|ST_CompoundCurve|ST_LineString||3|ST_LineString|ST_CircularString|ST_LineString||| +ST_IsClosed|f ----------------------------------------------------------------------- Summary of changes: regress/core/curvetoline.sql | 1 + regress/core/curvetoline_expected | 1 + regress/core/sql-mm-compoundcurve.sql | 4 ++++ regress/core/sql-mm-compoundcurve_expected | 1 + 4 files changed, 7 insertions(+) hooks/post-receive -- PostGIS From trac at osgeo.org Mon Apr 13 14:32:29 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 21:32:29 -0000 Subject: [PostGIS] #6070: Crashes and unprotected NULL dereferencing Message-ID: <049.4a06654ec1aae58b1d7669b88a48f067@osgeo.org> #6070: Crashes and unprotected NULL dereferencing ---------------------+---------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: assigned Priority: medium | Milestone: PostGIS 3.2.10 Component: postgis | Version: 3.2.x Keywords: | ---------------------+---------------------------- In response to a security report, multiple small NULL dereferencing cases and potential crashes on invalid input were corrected. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 13 14:35:43 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 13 Apr 2026 21:35:43 -0000 Subject: [PostGIS] #6070: Crashes and unprotected NULL dereferencing In-Reply-To: <049.4a06654ec1aae58b1d7669b88a48f067@osgeo.org> References: <049.4a06654ec1aae58b1d7669b88a48f067@osgeo.org> Message-ID: <064.72f1c79ad6e3056428ca29834b029674@osgeo.org> #6070: Crashes and unprotected NULL dereferencing ----------------------+---------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.2.10 Component: postgis | Version: 3.2.x Resolution: fixed | Keywords: ----------------------+---------------------------- Changes (by pramsey): * resolution: => fixed * status: assigned => closed Comment: Patched in 3.6 and cherry-picked up and down the active branches. * [changeset:"1a9074a7b/git" 1a9074a7b/git] * [changeset:"fa01f2bdc/git" fa01f2bdc/git] * [changeset:"4c85dfa2c/git" 4c85dfa2c/git] * [changeset:"72c3a7a5e/git" 72c3a7a5e/git] * [changeset:"a3c90cfa2/git" a3c90cfa2/git] * [changeset:"7372f89ac/git" 7372f89ac/git] * [changeset:"16d388906/git" 16d388906/git] * [changeset:"44ac9bc46/git" 44ac9bc46/git] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Mon Apr 13 15:04:21 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 15:04:21 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-16-gb4ea0262f Message-ID: <20260413220422.0528E18DDBB@trac.osgeo.org> 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.2 has been updated via b4ea0262f3fc1bcf4abaf49c3cd4f4d6d5eb802d (commit) via 786b763f08b5fa69fed1783c2c6073a254e1113b (commit) via 34e5211f8c0816e13fe81035e8a5587ab798d5ee (commit) via c6da4cf2426b4ee04e8504f22bf18f41f20c5edc (commit) via 07a47d8b663472d35a52e601f0967073fb578f0b (commit) via 078ff5c64fe11a0aadbd1141d7e9c342a284c15f (commit) via 76c1645c281b62be8220a2b2dfd38de388483df8 (commit) via 7435e5a94dc11027b933ce023606c5ed431a23df (commit) from 4c42e775cf77ea08e3a5999c561f1e8ebcd03ddb (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 b4ea0262f3fc1bcf4abaf49c3cd4f4d6d5eb802d Author: Paul Ramsey Date: Fri Apr 10 16:33:36 2026 -0700 Remove potential null dereference in ptarray_calc_areas() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index 3c038c5f5..c22bde282 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -358,6 +358,9 @@ void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, do const double *P2; const double *P3; + if (npoints < 2) + lwerror("%s: not enough points provided", __func__); + P1 = (double*)getPoint_internal(ea->inpts, 0); P2 = (double*)getPoint_internal(ea->inpts, 1); commit 786b763f08b5fa69fed1783c2c6073a254e1113b Author: Paul Ramsey Date: Fri Apr 10 16:33:16 2026 -0700 Remove potential null dereference in lwcircstring_linearize() diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c index ff025ffde..06ef95c78 100644 --- a/liblwgeom/lwstroke.c +++ b/liblwgeom/lwstroke.c @@ -565,8 +565,11 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, return NULL; } } - getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); - ptarray_append_point(ptarray, &p1, LW_FALSE); + if (icurve->points->npoints > 0) + { + getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); + ptarray_append_point(ptarray, &p1, LW_FALSE); + } oline = lwline_construct(icurve->srid, NULL, ptarray); return oline; commit 34e5211f8c0816e13fe81035e8a5587ab798d5ee Author: Paul Ramsey Date: Fri Apr 10 15:55:18 2026 -0700 Remove potential null dereference in pt_in_ring_3d() diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 49889bf31..ab9b2387e 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -1580,6 +1580,9 @@ pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane) POINT3DZ first, last; + if ( !ring || ring->npoints == 0 ) + lwerror("%s called on empty pointarray", __func__); + getPoint3dz_p(ring, 0, &first); getPoint3dz_p(ring, ring->npoints - 1, &last); if (memcmp(&first, &last, sizeof(POINT3DZ))) commit c6da4cf2426b4ee04e8504f22bf18f41f20c5edc Author: Paul Ramsey Date: Fri Apr 10 15:36:05 2026 -0700 Remove potential null dereference from ptarray_contains_point_partial() diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index e106d2372..45cdb25b3 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1023,10 +1023,14 @@ ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int chec const POINT2D *seg2; double ymin, ymax; + if ( !pa || !pa->npoints ) + lwerror("%s called on empty pointarray", __func__); + seg1 = getPoint2d_cp(pa, 0); seg2 = getPoint2d_cp(pa, pa->npoints-1); + if ( check_closed && ! p2d_same(seg1, seg2) ) - lwerror("ptarray_contains_point called on unclosed ring"); + lwerror("%s called on unclosed ring", __func__); for ( i=1; i < pa->npoints; i++ ) { commit 07a47d8b663472d35a52e601f0967073fb578f0b Author: Paul Ramsey Date: Fri Apr 10 15:31:16 2026 -0700 Remove unused function pt_in_ring_2d() diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index bc74527bf..8b9e556ae 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1351,7 +1351,6 @@ extern LWPOINT* lwcompound_get_endpoint(const LWCOMPOUND *lwcmp); extern LWPOINT* lwcompound_get_lwpoint(const LWCOMPOUND *lwcmp, uint32_t where); extern double ptarray_length_2d(const POINTARRAY *pts); -extern int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); extern int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret); extern int lwpoint_inside_circle(const LWPOINT *p, double cx, double cy, double rad); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 769822058..1c8249e9e 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -429,7 +429,6 @@ int lw_pt_in_arc(const POINT2D *P, const POINT2D *A1, const POINT2D *A2, const P int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); double lw_seg_length(const POINT2D *A1, const POINT2D *A2); double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); -int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number); diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 3cf3a7d33..1697320c1 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -285,62 +285,6 @@ lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D * return cr; } -int -pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring) -{ - int cn = 0; /* the crossing number counter */ - uint32_t i; - const POINT2D *v1, *v2; - const POINT2D *first, *last; - - first = getPoint2d_cp(ring, 0); - last = getPoint2d_cp(ring, ring->npoints-1); - if ( memcmp(first, last, sizeof(POINT2D)) ) - { - lwerror("pt_in_ring_2d: V[n] != V[0] (%g %g != %g %g)", - first->x, first->y, last->x, last->y); - return LW_FALSE; - - } - - LWDEBUGF(2, "pt_in_ring_2d called with point: %g %g", p->x, p->y); - /* printPA(ring); */ - - /* loop through all edges of the polygon */ - v1 = getPoint2d_cp(ring, 0); - for (i=0; inpoints-1; i++) - { - double vt; - v2 = getPoint2d_cp(ring, i+1); - - /* edge from vertex i to vertex i+1 */ - if - ( - /* an upward crossing */ - ((v1->y <= p->y) && (v2->y > p->y)) - /* a downward crossing */ - || ((v1->y > p->y) && (v2->y <= p->y)) - ) - { - - vt = (double)(p->y - v1->y) / (v2->y - v1->y); - - /* P->x x < v1->x + vt * (v2->x - v1->x)) - { - /* a valid crossing of y=p->y right of p->x */ - ++cn; - } - } - v1 = v2; - } - - LWDEBUGF(3, "pt_in_ring_2d returning %d", cn&1); - - return (cn&1); /* 0 if even (out), and 1 if odd (in) */ -} - - static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2) { commit 078ff5c64fe11a0aadbd1141d7e9c342a284c15f Author: Paul Ramsey Date: Fri Apr 10 15:29:19 2026 -0700 Remove reported crash in lwcompound_add_lwgeom() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 78c7db0c2..9368c1c89 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -155,6 +155,9 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom) /* Last point of the previous component */ LWLINE *prevline = (LWLINE*)(col->geoms[col->ngeoms-1]); + if (lwline_is_empty(prevline)) + return LW_FAILURE; + getPoint4d_p(newline->points, 0, &first); getPoint4d_p(prevline->points, prevline->points->npoints-1, &last); commit 76c1645c281b62be8220a2b2dfd38de388483df8 Author: Paul Ramsey Date: Fri Apr 10 13:56:41 2026 -0700 Remove reported crash in lwline_set_effective_area() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index e9859218d..3c038c5f5 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -464,7 +464,8 @@ static LWLINE* lwline_set_effective_area(const LWLINE *iline,int set_area, doubl LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m); - + if (iline->points->npoints < 2) + return oline; oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld)); @@ -491,7 +492,12 @@ static LWPOLY* lwpoly_set_effective_area(const LWPOLY *ipoly,int set_area, doubl for (i = 0; i < ipoly->nrings; i++) { - POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); + POINTARRAY *pa; + + if (ipoly->rings[i]->npoints < 4) + continue; + + pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); /* Add ring to simplified polygon */ if(pa->npoints>=4) { commit 7435e5a94dc11027b933ce023606c5ed431a23df Author: Paul Ramsey Date: Fri Apr 10 14:56:21 2026 -0700 Remove reported crash in lwcompound_is_closed() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index f7363d069..78c7db0c2 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -29,43 +29,94 @@ #include "liblwgeom_internal.h" #include "lwgeom_log.h" - - -int -lwcompound_is_closed(const LWCOMPOUND *compound) +static int +lwcompound_is_valid(const LWCOMPOUND *compound) { - size_t size; - int npoints=0; + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); + if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) + return LW_TRUE; - if ( lwgeom_has_z((LWGEOM*)compound) ) - { - size = sizeof(POINT3D); - } - else - { - size = sizeof(POINT2D); - } + /* Only one component, do not need to test connectivity */ + if (compound->ngeoms == 1) + return LW_TRUE; - if ( compound->geoms[compound->ngeoms - 1]->type == CIRCSTRINGTYPE ) + /* Check internal connectivity between components */ + for (uint32_t i = 1; i < compound->ngeoms; i++) { - npoints = ((LWCIRCSTRING *)compound->geoms[compound->ngeoms - 1])->points->npoints; - } - else if (compound->geoms[compound->ngeoms - 1]->type == LINETYPE) - { - npoints = ((LWLINE *)compound->geoms[compound->ngeoms - 1])->points->npoints; - } + const POINTARRAY *pa_start, *pa_end; + const LWLINE *line_start = (LWLINE *)(compound->geoms[i]); + const LWLINE *line_end = (LWLINE *)(compound->geoms[i-1]); - if ( memcmp(getPoint_internal( (POINTARRAY *)compound->geoms[0]->data, 0), - getPoint_internal( (POINTARRAY *)compound->geoms[compound->ngeoms - 1]->data, - npoints - 1), - size) ) - { - return LW_FALSE; + /* Empty cannot be a compound component, because it joins nothing */ + if (lwline_is_empty(line_start) || (lwline_is_empty(line_end))) + return LW_FALSE; + + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) + { + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; + } } return LW_TRUE; } +int +lwcompound_is_closed(const LWCOMPOUND *compound) +{ + const LWLINE *line_start, *line_end; + const POINTARRAY *pa_start, *pa_end; + + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); + if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) + return LW_FALSE; + + /* Single entry, closes on itself */ + if (compound->ngeoms == 1 && lwline_is_closed((LWLINE *)(compound->geoms[0]))) + return LW_TRUE; + + /* If internal connectivity is lacking, so is closure */ + if (!lwcompound_is_valid(compound)) + return LW_FALSE; + + /* Internal connection is good, what about start/end points? */ + line_start = (LWLINE *)(compound->geoms[0]); + line_end = (LWLINE *)(compound->geoms[compound->ngeoms-1]); + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) + { + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; + } + + return LW_TRUE; +} + + + double lwcompound_length(const LWCOMPOUND *comp) { return lwcompound_length_2d(comp); ----------------------------------------------------------------------- Summary of changes: liblwgeom/effectivearea.c | 13 +++++- liblwgeom/liblwgeom.h.in | 1 - liblwgeom/liblwgeom_internal.h | 1 - liblwgeom/lwalgorithm.c | 56 ------------------------ liblwgeom/lwcompound.c | 98 ++++++++++++++++++++++++++++++++---------- liblwgeom/lwstroke.c | 7 ++- liblwgeom/measures3d.c | 3 ++ liblwgeom/ptarray.c | 6 ++- 8 files changed, 100 insertions(+), 85 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Apr 13 15:04:28 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 15:04:28 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-22-g102a01e17 Message-ID: <20260413220429.63E6D18D9BB@trac.osgeo.org> 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.3 has been updated via 102a01e1772da6bab7f00e10d3ba59bb4ad14257 (commit) via 115776de970e993965e3f9c5dc65ff0aae844f31 (commit) via 6d1c0b91486a5c2b96cf84453b159788374981ec (commit) via a3c90cfa25317ad6af5c3f974e0176b2994b6558 (commit) via febb2a5b161cac21fd0fb94089e1af86f265ffbb (commit) via fea8ca4f0b605d4b67e96171889e26f47959b9e9 (commit) via e06b93f22b628f49cc2697144f826dadf2925da5 (commit) via 9f00e91bf9217b6d744209e03240b40a9f21624c (commit) from 273382ac81dd25af5236f69c36d6414e28928fa1 (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 102a01e1772da6bab7f00e10d3ba59bb4ad14257 Author: Paul Ramsey Date: Fri Apr 10 16:33:36 2026 -0700 Remove potential null dereference in ptarray_calc_areas() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index 3c038c5f5..c22bde282 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -358,6 +358,9 @@ void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, do const double *P2; const double *P3; + if (npoints < 2) + lwerror("%s: not enough points provided", __func__); + P1 = (double*)getPoint_internal(ea->inpts, 0); P2 = (double*)getPoint_internal(ea->inpts, 1); commit 115776de970e993965e3f9c5dc65ff0aae844f31 Author: Paul Ramsey Date: Fri Apr 10 16:33:16 2026 -0700 Remove potential null dereference in lwcircstring_linearize() diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c index ff025ffde..06ef95c78 100644 --- a/liblwgeom/lwstroke.c +++ b/liblwgeom/lwstroke.c @@ -565,8 +565,11 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, return NULL; } } - getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); - ptarray_append_point(ptarray, &p1, LW_FALSE); + if (icurve->points->npoints > 0) + { + getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); + ptarray_append_point(ptarray, &p1, LW_FALSE); + } oline = lwline_construct(icurve->srid, NULL, ptarray); return oline; commit 6d1c0b91486a5c2b96cf84453b159788374981ec Author: Paul Ramsey Date: Fri Apr 10 15:55:18 2026 -0700 Remove potential null dereference in pt_in_ring_3d() diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 49889bf31..ab9b2387e 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -1580,6 +1580,9 @@ pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane) POINT3DZ first, last; + if ( !ring || ring->npoints == 0 ) + lwerror("%s called on empty pointarray", __func__); + getPoint3dz_p(ring, 0, &first); getPoint3dz_p(ring, ring->npoints - 1, &last); if (memcmp(&first, &last, sizeof(POINT3DZ))) commit a3c90cfa25317ad6af5c3f974e0176b2994b6558 Author: Paul Ramsey Date: Fri Apr 10 15:36:05 2026 -0700 Remove potential null dereference from ptarray_contains_point_partial() diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index e106d2372..45cdb25b3 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1023,10 +1023,14 @@ ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int chec const POINT2D *seg2; double ymin, ymax; + if ( !pa || !pa->npoints ) + lwerror("%s called on empty pointarray", __func__); + seg1 = getPoint2d_cp(pa, 0); seg2 = getPoint2d_cp(pa, pa->npoints-1); + if ( check_closed && ! p2d_same(seg1, seg2) ) - lwerror("ptarray_contains_point called on unclosed ring"); + lwerror("%s called on unclosed ring", __func__); for ( i=1; i < pa->npoints; i++ ) { commit febb2a5b161cac21fd0fb94089e1af86f265ffbb Author: Paul Ramsey Date: Fri Apr 10 15:31:16 2026 -0700 Remove unused function pt_in_ring_2d() diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 9a042f586..91f97076e 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1352,7 +1352,6 @@ extern LWPOINT* lwcompound_get_endpoint(const LWCOMPOUND *lwcmp); extern LWPOINT* lwcompound_get_lwpoint(const LWCOMPOUND *lwcmp, uint32_t where); extern double ptarray_length_2d(const POINTARRAY *pts); -extern int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); extern int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret); extern int lwpoint_inside_circle(const LWPOINT *p, double cx, double cy, double rad); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index cb3565c71..8604ee756 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -438,7 +438,6 @@ int lw_pt_in_arc(const POINT2D *P, const POINT2D *A1, const POINT2D *A2, const P int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); double lw_seg_length(const POINT2D *A1, const POINT2D *A2); double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); -int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number); diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 3cf3a7d33..1697320c1 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -285,62 +285,6 @@ lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D * return cr; } -int -pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring) -{ - int cn = 0; /* the crossing number counter */ - uint32_t i; - const POINT2D *v1, *v2; - const POINT2D *first, *last; - - first = getPoint2d_cp(ring, 0); - last = getPoint2d_cp(ring, ring->npoints-1); - if ( memcmp(first, last, sizeof(POINT2D)) ) - { - lwerror("pt_in_ring_2d: V[n] != V[0] (%g %g != %g %g)", - first->x, first->y, last->x, last->y); - return LW_FALSE; - - } - - LWDEBUGF(2, "pt_in_ring_2d called with point: %g %g", p->x, p->y); - /* printPA(ring); */ - - /* loop through all edges of the polygon */ - v1 = getPoint2d_cp(ring, 0); - for (i=0; inpoints-1; i++) - { - double vt; - v2 = getPoint2d_cp(ring, i+1); - - /* edge from vertex i to vertex i+1 */ - if - ( - /* an upward crossing */ - ((v1->y <= p->y) && (v2->y > p->y)) - /* a downward crossing */ - || ((v1->y > p->y) && (v2->y <= p->y)) - ) - { - - vt = (double)(p->y - v1->y) / (v2->y - v1->y); - - /* P->x x < v1->x + vt * (v2->x - v1->x)) - { - /* a valid crossing of y=p->y right of p->x */ - ++cn; - } - } - v1 = v2; - } - - LWDEBUGF(3, "pt_in_ring_2d returning %d", cn&1); - - return (cn&1); /* 0 if even (out), and 1 if odd (in) */ -} - - static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2) { commit fea8ca4f0b605d4b67e96171889e26f47959b9e9 Author: Paul Ramsey Date: Fri Apr 10 15:29:19 2026 -0700 Remove reported crash in lwcompound_add_lwgeom() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 78c7db0c2..9368c1c89 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -155,6 +155,9 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom) /* Last point of the previous component */ LWLINE *prevline = (LWLINE*)(col->geoms[col->ngeoms-1]); + if (lwline_is_empty(prevline)) + return LW_FAILURE; + getPoint4d_p(newline->points, 0, &first); getPoint4d_p(prevline->points, prevline->points->npoints-1, &last); commit e06b93f22b628f49cc2697144f826dadf2925da5 Author: Paul Ramsey Date: Fri Apr 10 13:56:41 2026 -0700 Remove reported crash in lwline_set_effective_area() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index e9859218d..3c038c5f5 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -464,7 +464,8 @@ static LWLINE* lwline_set_effective_area(const LWLINE *iline,int set_area, doubl LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m); - + if (iline->points->npoints < 2) + return oline; oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld)); @@ -491,7 +492,12 @@ static LWPOLY* lwpoly_set_effective_area(const LWPOLY *ipoly,int set_area, doubl for (i = 0; i < ipoly->nrings; i++) { - POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); + POINTARRAY *pa; + + if (ipoly->rings[i]->npoints < 4) + continue; + + pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); /* Add ring to simplified polygon */ if(pa->npoints>=4) { commit 9f00e91bf9217b6d744209e03240b40a9f21624c Author: Paul Ramsey Date: Fri Apr 10 14:56:21 2026 -0700 Remove reported crash in lwcompound_is_closed() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index f7363d069..78c7db0c2 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -29,43 +29,94 @@ #include "liblwgeom_internal.h" #include "lwgeom_log.h" - - -int -lwcompound_is_closed(const LWCOMPOUND *compound) +static int +lwcompound_is_valid(const LWCOMPOUND *compound) { - size_t size; - int npoints=0; + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); + if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) + return LW_TRUE; - if ( lwgeom_has_z((LWGEOM*)compound) ) - { - size = sizeof(POINT3D); - } - else - { - size = sizeof(POINT2D); - } + /* Only one component, do not need to test connectivity */ + if (compound->ngeoms == 1) + return LW_TRUE; - if ( compound->geoms[compound->ngeoms - 1]->type == CIRCSTRINGTYPE ) + /* Check internal connectivity between components */ + for (uint32_t i = 1; i < compound->ngeoms; i++) { - npoints = ((LWCIRCSTRING *)compound->geoms[compound->ngeoms - 1])->points->npoints; - } - else if (compound->geoms[compound->ngeoms - 1]->type == LINETYPE) - { - npoints = ((LWLINE *)compound->geoms[compound->ngeoms - 1])->points->npoints; - } + const POINTARRAY *pa_start, *pa_end; + const LWLINE *line_start = (LWLINE *)(compound->geoms[i]); + const LWLINE *line_end = (LWLINE *)(compound->geoms[i-1]); - if ( memcmp(getPoint_internal( (POINTARRAY *)compound->geoms[0]->data, 0), - getPoint_internal( (POINTARRAY *)compound->geoms[compound->ngeoms - 1]->data, - npoints - 1), - size) ) - { - return LW_FALSE; + /* Empty cannot be a compound component, because it joins nothing */ + if (lwline_is_empty(line_start) || (lwline_is_empty(line_end))) + return LW_FALSE; + + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) + { + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; + } } return LW_TRUE; } +int +lwcompound_is_closed(const LWCOMPOUND *compound) +{ + const LWLINE *line_start, *line_end; + const POINTARRAY *pa_start, *pa_end; + + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); + if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) + return LW_FALSE; + + /* Single entry, closes on itself */ + if (compound->ngeoms == 1 && lwline_is_closed((LWLINE *)(compound->geoms[0]))) + return LW_TRUE; + + /* If internal connectivity is lacking, so is closure */ + if (!lwcompound_is_valid(compound)) + return LW_FALSE; + + /* Internal connection is good, what about start/end points? */ + line_start = (LWLINE *)(compound->geoms[0]); + line_end = (LWLINE *)(compound->geoms[compound->ngeoms-1]); + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) + { + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; + } + + return LW_TRUE; +} + + + double lwcompound_length(const LWCOMPOUND *comp) { return lwcompound_length_2d(comp); ----------------------------------------------------------------------- Summary of changes: liblwgeom/effectivearea.c | 13 +++++- liblwgeom/liblwgeom.h.in | 1 - liblwgeom/liblwgeom_internal.h | 1 - liblwgeom/lwalgorithm.c | 56 ------------------------ liblwgeom/lwcompound.c | 98 ++++++++++++++++++++++++++++++++---------- liblwgeom/lwstroke.c | 7 ++- liblwgeom/measures3d.c | 3 ++ liblwgeom/ptarray.c | 6 ++- 8 files changed, 100 insertions(+), 85 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Apr 13 15:04:30 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 15:04:30 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-24-g399e2f18c Message-ID: <20260413220430.B1C2D18DE97@trac.osgeo.org> 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.4 has been updated via 399e2f18c249ea272ffefd974c110a4c69a213c4 (commit) via 2078e0c88c93b392e9efaf46dad4cac80a287ed7 (commit) via 4400c58d090f82de491e13a9cf5fe6c90336079d (commit) via 4808f465b86df6b9b69d569cef36acefc43be710 (commit) via 53f3e6fe28a25a3dc08672bcc91d0549542fcf59 (commit) via 02597250d8753f072363872d35b558fd43911d24 (commit) via 10f8aa4840b2fa57f8d24abc92dd1b3f36d92daa (commit) via 1a9074a7bbbea7ea5f24af593034485cdd499a26 (commit) from 77143e9908ff70d7d8085a2559de21fc85a9950c (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 399e2f18c249ea272ffefd974c110a4c69a213c4 Author: Paul Ramsey Date: Fri Apr 10 16:33:36 2026 -0700 Remove potential null dereference in ptarray_calc_areas() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index 3c038c5f5..c22bde282 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -358,6 +358,9 @@ void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, do const double *P2; const double *P3; + if (npoints < 2) + lwerror("%s: not enough points provided", __func__); + P1 = (double*)getPoint_internal(ea->inpts, 0); P2 = (double*)getPoint_internal(ea->inpts, 1); commit 2078e0c88c93b392e9efaf46dad4cac80a287ed7 Author: Paul Ramsey Date: Fri Apr 10 16:33:16 2026 -0700 Remove potential null dereference in lwcircstring_linearize() diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c index ff025ffde..06ef95c78 100644 --- a/liblwgeom/lwstroke.c +++ b/liblwgeom/lwstroke.c @@ -565,8 +565,11 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, return NULL; } } - getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); - ptarray_append_point(ptarray, &p1, LW_FALSE); + if (icurve->points->npoints > 0) + { + getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); + ptarray_append_point(ptarray, &p1, LW_FALSE); + } oline = lwline_construct(icurve->srid, NULL, ptarray); return oline; commit 4400c58d090f82de491e13a9cf5fe6c90336079d Author: Paul Ramsey Date: Fri Apr 10 15:55:18 2026 -0700 Remove potential null dereference in pt_in_ring_3d() diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 49889bf31..ab9b2387e 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -1580,6 +1580,9 @@ pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane) POINT3DZ first, last; + if ( !ring || ring->npoints == 0 ) + lwerror("%s called on empty pointarray", __func__); + getPoint3dz_p(ring, 0, &first); getPoint3dz_p(ring, ring->npoints - 1, &last); if (memcmp(&first, &last, sizeof(POINT3DZ))) commit 4808f465b86df6b9b69d569cef36acefc43be710 Author: Paul Ramsey Date: Fri Apr 10 15:36:05 2026 -0700 Remove potential null dereference from ptarray_contains_point_partial() diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 12114bbf2..1e62b50b8 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1042,11 +1042,14 @@ ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt) const POINT2D *seg1, *seg2; int wn = 0; + if ( !pa || !pa->npoints ) + lwerror("%s called on empty pointarray", __func__); + seg1 = getPoint2d_cp(pa, 0); seg2 = getPoint2d_cp(pa, pa->npoints-1); if (!p2d_same(seg1, seg2)) - lwerror("ptarray_contains_point called on unclosed ring"); + lwerror("%s called on unclosed ring", __func__); for (uint32_t i = 1; i < pa->npoints; i++) { commit 53f3e6fe28a25a3dc08672bcc91d0549542fcf59 Author: Paul Ramsey Date: Fri Apr 10 15:31:16 2026 -0700 Remove unused function pt_in_ring_2d() diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index 69ed8f354..ab2ff2114 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1342,7 +1342,6 @@ extern LWPOINT* lwcompound_get_endpoint(const LWCOMPOUND *lwcmp); extern LWPOINT* lwcompound_get_lwpoint(const LWCOMPOUND *lwcmp, uint32_t where); extern double ptarray_length_2d(const POINTARRAY *pts); -extern int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); extern int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret); extern LWPOINT* lwpoint_project_lwpoint(const LWPOINT* lwpoint1, const LWPOINT* lwpoint2, double distance); extern LWPOINT* lwpoint_project(const LWPOINT* lwpoint1, double distance, double azimuth); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 66dabaffa..86816ddd5 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -446,7 +446,6 @@ int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); int lw_pt_on_segment(const POINT2D* p1, const POINT2D* p2, const POINT2D* p); double lw_seg_length(const POINT2D *A1, const POINT2D *A2); double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); -int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number); diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 3cf3a7d33..1697320c1 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -285,62 +285,6 @@ lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D * return cr; } -int -pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring) -{ - int cn = 0; /* the crossing number counter */ - uint32_t i; - const POINT2D *v1, *v2; - const POINT2D *first, *last; - - first = getPoint2d_cp(ring, 0); - last = getPoint2d_cp(ring, ring->npoints-1); - if ( memcmp(first, last, sizeof(POINT2D)) ) - { - lwerror("pt_in_ring_2d: V[n] != V[0] (%g %g != %g %g)", - first->x, first->y, last->x, last->y); - return LW_FALSE; - - } - - LWDEBUGF(2, "pt_in_ring_2d called with point: %g %g", p->x, p->y); - /* printPA(ring); */ - - /* loop through all edges of the polygon */ - v1 = getPoint2d_cp(ring, 0); - for (i=0; inpoints-1; i++) - { - double vt; - v2 = getPoint2d_cp(ring, i+1); - - /* edge from vertex i to vertex i+1 */ - if - ( - /* an upward crossing */ - ((v1->y <= p->y) && (v2->y > p->y)) - /* a downward crossing */ - || ((v1->y > p->y) && (v2->y <= p->y)) - ) - { - - vt = (double)(p->y - v1->y) / (v2->y - v1->y); - - /* P->x x < v1->x + vt * (v2->x - v1->x)) - { - /* a valid crossing of y=p->y right of p->x */ - ++cn; - } - } - v1 = v2; - } - - LWDEBUGF(3, "pt_in_ring_2d returning %d", cn&1); - - return (cn&1); /* 0 if even (out), and 1 if odd (in) */ -} - - static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2) { commit 02597250d8753f072363872d35b558fd43911d24 Author: Paul Ramsey Date: Fri Apr 10 15:29:19 2026 -0700 Remove reported crash in lwcompound_add_lwgeom() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 3fc5de4f7..94fe04a52 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -155,6 +155,9 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom) /* Last point of the previous component */ LWLINE *prevline = (LWLINE*)(col->geoms[col->ngeoms-1]); + if (lwline_is_empty(prevline)) + return LW_FAILURE; + getPoint4d_p(newline->points, 0, &first); getPoint4d_p(prevline->points, prevline->points->npoints-1, &last); commit 10f8aa4840b2fa57f8d24abc92dd1b3f36d92daa Author: Paul Ramsey Date: Fri Apr 10 13:56:41 2026 -0700 Remove reported crash in lwline_set_effective_area() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index e9859218d..3c038c5f5 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -464,7 +464,8 @@ static LWLINE* lwline_set_effective_area(const LWLINE *iline,int set_area, doubl LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m); - + if (iline->points->npoints < 2) + return oline; oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld)); @@ -491,7 +492,12 @@ static LWPOLY* lwpoly_set_effective_area(const LWPOLY *ipoly,int set_area, doubl for (i = 0; i < ipoly->nrings; i++) { - POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); + POINTARRAY *pa; + + if (ipoly->rings[i]->npoints < 4) + continue; + + pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); /* Add ring to simplified polygon */ if(pa->npoints>=4) { commit 1a9074a7bbbea7ea5f24af593034485cdd499a26 Author: Paul Ramsey Date: Fri Apr 10 14:56:21 2026 -0700 Remove reported crash in lwcompound_is_closed() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 666b455da..3fc5de4f7 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -29,43 +29,94 @@ #include "liblwgeom_internal.h" #include "lwgeom_log.h" - - -int -lwcompound_is_closed(const LWCOMPOUND *compound) +static int +lwcompound_is_valid(const LWCOMPOUND *compound) { - size_t size; - int npoints=0; + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); + if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) + return LW_TRUE; - if ( lwgeom_has_z((LWGEOM*)compound) ) - { - size = sizeof(POINT3D); - } - else - { - size = sizeof(POINT2D); - } + /* Only one component, do not need to test connectivity */ + if (compound->ngeoms == 1) + return LW_TRUE; - if ( compound->geoms[compound->ngeoms - 1]->type == CIRCSTRINGTYPE ) + /* Check internal connectivity between components */ + for (uint32_t i = 1; i < compound->ngeoms; i++) { - npoints = ((LWCIRCSTRING *)compound->geoms[compound->ngeoms - 1])->points->npoints; - } - else if (compound->geoms[compound->ngeoms - 1]->type == LINETYPE) - { - npoints = ((LWLINE *)compound->geoms[compound->ngeoms - 1])->points->npoints; - } + const POINTARRAY *pa_start, *pa_end; + const LWLINE *line_start = (LWLINE *)(compound->geoms[i]); + const LWLINE *line_end = (LWLINE *)(compound->geoms[i-1]); - if ( memcmp(getPoint_internal( (POINTARRAY *)compound->geoms[0]->data, 0), - getPoint_internal( (POINTARRAY *)compound->geoms[compound->ngeoms - 1]->data, - npoints - 1), - size) ) - { - return LW_FALSE; + /* Empty cannot be a compound component, because it joins nothing */ + if (lwline_is_empty(line_start) || (lwline_is_empty(line_end))) + return LW_FALSE; + + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) + { + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; + } } return LW_TRUE; } +int +lwcompound_is_closed(const LWCOMPOUND *compound) +{ + const LWLINE *line_start, *line_end; + const POINTARRAY *pa_start, *pa_end; + + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); + if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) + return LW_FALSE; + + /* Single entry, closes on itself */ + if (compound->ngeoms == 1 && lwline_is_closed((LWLINE *)(compound->geoms[0]))) + return LW_TRUE; + + /* If internal connectivity is lacking, so is closure */ + if (!lwcompound_is_valid(compound)) + return LW_FALSE; + + /* Internal connection is good, what about start/end points? */ + line_start = (LWLINE *)(compound->geoms[0]); + line_end = (LWLINE *)(compound->geoms[compound->ngeoms-1]); + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) + { + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; + } + + return LW_TRUE; +} + + + double lwcompound_length(const LWCOMPOUND *comp) { return lwcompound_length_2d(comp); ----------------------------------------------------------------------- Summary of changes: liblwgeom/effectivearea.c | 13 +++++- liblwgeom/liblwgeom.h.in | 1 - liblwgeom/liblwgeom_internal.h | 1 - liblwgeom/lwalgorithm.c | 56 ------------------------ liblwgeom/lwcompound.c | 98 ++++++++++++++++++++++++++++++++---------- liblwgeom/lwstroke.c | 7 ++- liblwgeom/measures3d.c | 3 ++ liblwgeom/ptarray.c | 5 ++- 8 files changed, 99 insertions(+), 85 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Mon Apr 13 15:04:33 2026 From: git at osgeo.org (git at osgeo.org) Date: Mon, 13 Apr 2026 15:04:33 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-22-g396dc1bcc Message-ID: <20260413220433.C354618D7DC@trac.osgeo.org> 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.5 has been updated via 396dc1bcc320bb69d15ff2ad74a5eeb4418e2ae2 (commit) via dc05b0e0fb056784f3a3d400eb54861bc78d6d5a (commit) via dd7d5280d5e294a1fb6e0a915ef1cfff0345fcd2 (commit) via c646c8e8e6c54ef1e201716507237b851e92cd3b (commit) via 728235fd0c3df1c74117a63a0defd1b995dfd0d1 (commit) via 4c77c0fe93dc70f71d1949c4da04b188e272ca37 (commit) via bcd6d8b43280afc28e3662c5665ffd7fd894d210 (commit) via c07c4cae465d376e2e70f9f80f6216ab8b0f14f5 (commit) from 66fcfd047860ee8c675738fe0a40356b7a42ec32 (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 396dc1bcc320bb69d15ff2ad74a5eeb4418e2ae2 Author: Paul Ramsey Date: Fri Apr 10 16:33:36 2026 -0700 Remove potential null dereference in ptarray_calc_areas() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index d0bfd0981..77774839d 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -358,6 +358,9 @@ void ptarray_calc_areas(EFFECTIVE_AREAS *ea, int avoid_collaps, int set_area, do const double *P2; const double *P3; + if (npoints < 2) + lwerror("%s: not enough points provided", __func__); + P1 = (double*)getPoint_internal(ea->inpts, 0); P2 = (double*)getPoint_internal(ea->inpts, 1); commit dc05b0e0fb056784f3a3d400eb54861bc78d6d5a Author: Paul Ramsey Date: Fri Apr 10 16:33:16 2026 -0700 Remove potential null dereference in lwcircstring_linearize() diff --git a/liblwgeom/lwstroke.c b/liblwgeom/lwstroke.c index 3adfeb055..5bea73a24 100644 --- a/liblwgeom/lwstroke.c +++ b/liblwgeom/lwstroke.c @@ -565,8 +565,11 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol, return NULL; } } - getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); - ptarray_append_point(ptarray, &p1, LW_FALSE); + if (icurve->points->npoints > 0) + { + getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1); + ptarray_append_point(ptarray, &p1, LW_FALSE); + } oline = lwline_construct(icurve->srid, NULL, ptarray); return oline; commit dd7d5280d5e294a1fb6e0a915ef1cfff0345fcd2 Author: Paul Ramsey Date: Fri Apr 10 15:55:18 2026 -0700 Remove potential null dereference in pt_in_ring_3d() diff --git a/liblwgeom/measures3d.c b/liblwgeom/measures3d.c index 57b29ffe2..bc3e6d063 100644 --- a/liblwgeom/measures3d.c +++ b/liblwgeom/measures3d.c @@ -1579,6 +1579,9 @@ pt_in_ring_3d(const POINT3DZ *p, const POINTARRAY *ring, PLANE3D *plane) POINT3DZ first, last; + if ( !ring || ring->npoints == 0 ) + lwerror("%s called on empty pointarray", __func__); + getPoint3dz_p(ring, 0, &first); getPoint3dz_p(ring, ring->npoints - 1, &last); if (memcmp(&first, &last, sizeof(POINT3DZ))) commit c646c8e8e6c54ef1e201716507237b851e92cd3b Author: Paul Ramsey Date: Fri Apr 10 15:36:05 2026 -0700 Remove potential null dereference from ptarray_contains_point_partial() diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 2369bff18..15bf792e7 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1036,10 +1036,13 @@ ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int chec const POINT2D *seg1, *seg2; double ymin, ymax; + if ( !pa || !pa->npoints ) + lwerror("%s called on empty pointarray", __func__); + seg1 = getPoint2d_cp(pa, 0); seg2 = getPoint2d_cp(pa, pa->npoints-1); if ( check_closed && ! p2d_same(seg1, seg2) ) - lwerror("ptarray_contains_point called on unclosed ring"); + lwerror("%s called on unclosed ring", __func__); for ( i=1; i < pa->npoints; i++ ) { commit 728235fd0c3df1c74117a63a0defd1b995dfd0d1 Author: Paul Ramsey Date: Fri Apr 10 15:31:16 2026 -0700 Remove unused function pt_in_ring_2d() diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in index ee9b7d8c0..43a53bb6c 100644 --- a/liblwgeom/liblwgeom.h.in +++ b/liblwgeom/liblwgeom.h.in @@ -1360,7 +1360,6 @@ extern uint32_t lwcompound_num_curves(const LWCOMPOUND *compound); extern const LWGEOM *lwcollection_getsubcurve(const LWCOMPOUND *compound, uint32_t gnum); extern double ptarray_length_2d(const POINTARRAY *pts); -extern int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); extern int azimuth_pt_pt(const POINT2D *p1, const POINT2D *p2, double *ret); extern LWPOINT* lwpoint_project_lwpoint(const LWPOINT* lwpoint1, const LWPOINT* lwpoint2, double distance); extern LWPOINT* lwpoint_project(const LWPOINT* lwpoint1, double distance, double azimuth); diff --git a/liblwgeom/liblwgeom_internal.h b/liblwgeom/liblwgeom_internal.h index 0063b135a..43dc59220 100644 --- a/liblwgeom/liblwgeom_internal.h +++ b/liblwgeom/liblwgeom_internal.h @@ -448,7 +448,6 @@ int lw_arc_is_pt(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); int lw_pt_on_segment(const POINT2D* p1, const POINT2D* p2, const POINT2D* p); double lw_seg_length(const POINT2D *A1, const POINT2D *A2); double lw_arc_length(const POINT2D *A1, const POINT2D *A2, const POINT2D *A3); -int pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring); int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt); int ptarray_contains_point_partial(const POINTARRAY *pa, const POINT2D *pt, int check_closed, int *winding_number); diff --git a/liblwgeom/lwalgorithm.c b/liblwgeom/lwalgorithm.c index 56ce3e5ba..010a88e56 100644 --- a/liblwgeom/lwalgorithm.c +++ b/liblwgeom/lwalgorithm.c @@ -293,62 +293,6 @@ lw_arc_center(const POINT2D *p1, const POINT2D *p2, const POINT2D *p3, POINT2D * return cr; } -int -pt_in_ring_2d(const POINT2D *p, const POINTARRAY *ring) -{ - int cn = 0; /* the crossing number counter */ - uint32_t i; - const POINT2D *v1, *v2; - const POINT2D *first, *last; - - first = getPoint2d_cp(ring, 0); - last = getPoint2d_cp(ring, ring->npoints-1); - if ( memcmp(first, last, sizeof(POINT2D)) ) - { - lwerror("pt_in_ring_2d: V[n] != V[0] (%g %g != %g %g)", - first->x, first->y, last->x, last->y); - return LW_FALSE; - - } - - LWDEBUGF(2, "pt_in_ring_2d called with point: %g %g", p->x, p->y); - /* printPA(ring); */ - - /* loop through all edges of the polygon */ - v1 = getPoint2d_cp(ring, 0); - for (i=0; inpoints-1; i++) - { - double vt; - v2 = getPoint2d_cp(ring, i+1); - - /* edge from vertex i to vertex i+1 */ - if - ( - /* an upward crossing */ - ((v1->y <= p->y) && (v2->y > p->y)) - /* a downward crossing */ - || ((v1->y > p->y) && (v2->y <= p->y)) - ) - { - - vt = (double)(p->y - v1->y) / (v2->y - v1->y); - - /* P->x x < v1->x + vt * (v2->x - v1->x)) - { - /* a valid crossing of y=p->y right of p->x */ - ++cn; - } - } - v1 = v2; - } - - LWDEBUGF(3, "pt_in_ring_2d returning %d", cn&1); - - return (cn&1); /* 0 if even (out), and 1 if odd (in) */ -} - - static int lw_seg_interact(const POINT2D *p1, const POINT2D *p2, const POINT2D *q1, const POINT2D *q2) { commit 4c77c0fe93dc70f71d1949c4da04b188e272ca37 Author: Paul Ramsey Date: Fri Apr 10 15:29:19 2026 -0700 Remove reported crash in lwcompound_add_lwgeom() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 770acdc6b..f33b0f729 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -168,6 +168,9 @@ int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom) /* Last point of the previous component */ LWLINE *prevline = (LWLINE*)(col->geoms[col->ngeoms-1]); + if (lwline_is_empty(prevline)) + return LW_FAILURE; + getPoint4d_p(newline->points, 0, &first); getPoint4d_p(prevline->points, prevline->points->npoints-1, &last); commit bcd6d8b43280afc28e3662c5665ffd7fd894d210 Author: Paul Ramsey Date: Fri Apr 10 13:56:41 2026 -0700 Remove reported crash in lwline_set_effective_area() diff --git a/liblwgeom/effectivearea.c b/liblwgeom/effectivearea.c index ca3cdddea..d0bfd0981 100644 --- a/liblwgeom/effectivearea.c +++ b/liblwgeom/effectivearea.c @@ -464,7 +464,8 @@ static LWLINE* lwline_set_effective_area(const LWLINE *iline,int set_area, doubl LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m); - + if (iline->points->npoints < 2) + return oline; oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld)); @@ -491,7 +492,12 @@ static LWPOLY* lwpoly_set_effective_area(const LWPOLY *ipoly,int set_area, doubl for (i = 0; i < ipoly->nrings; i++) { - POINTARRAY *pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); + POINTARRAY *pa; + + if (ipoly->rings[i]->npoints < 4) + continue; + + pa = ptarray_set_effective_area(ipoly->rings[i],avoid_collapse,set_area,trshld); /* Add ring to simplified polygon */ if(pa->npoints>=4) { commit c07c4cae465d376e2e70f9f80f6216ab8b0f14f5 Author: Paul Ramsey Date: Fri Apr 10 14:56:21 2026 -0700 Remove reported crash in lwcompound_is_closed() diff --git a/liblwgeom/lwcompound.c b/liblwgeom/lwcompound.c index 1e0d5c2ee..770acdc6b 100644 --- a/liblwgeom/lwcompound.c +++ b/liblwgeom/lwcompound.c @@ -47,31 +47,40 @@ lwcollection_getsubcurve(const LWCOMPOUND *compound, uint32_t curvenum) int lwcompound_is_closed(const LWCOMPOUND *compound) { + const LWLINE *line_start, *line_end; + const POINTARRAY *pa_start, *pa_end; + int hasz = lwgeom_has_z(lwcompound_as_lwgeom(compound)); if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) return LW_FALSE; - for (uint32_t i = 0; i < compound->ngeoms; i++) + /* Single entry, closes on itself */ + if (compound->ngeoms == 1 && lwline_is_closed((LWLINE *)(compound->geoms[0]))) + return LW_TRUE; + + /* If internal connectivity is lacking, so is closure */ + if (!lwcompound_is_valid(compound)) + return LW_FALSE; + + /* Internal connection is good, what about start/end points? */ + line_start = (LWLINE *)(compound->geoms[0]); + line_end = (LWLINE *)(compound->geoms[compound->ngeoms-1]); + pa_start = line_start->points; + pa_end = line_end->points; + + if (hasz) { - uint32_t i_end = i == 0 ? compound->ngeoms - 1 : i - 1; - const LWLINE *geom_start = (LWLINE *)(compound->geoms[i]); - const LWLINE *geom_end = (LWLINE *)(compound->geoms[i_end]); - const POINTARRAY *pa_start = geom_start->points; - const POINTARRAY *pa_end = geom_end->points; - if (hasz) - { - const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); - const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); - if (!p3d_same(pt_start, pt_end)) - return LW_FALSE; - } - else - { - const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); - const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); - if (!p2d_same(pt_start, pt_end)) - return LW_FALSE; - } + const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); + const POINT3D *pt_end = getPoint3d_cp(pa_end, pa_end->npoints-1); + if (!p3d_same(pt_start, pt_end)) + return LW_FALSE; + } + else + { + const POINT2D *pt_start = getPoint2d_cp(pa_start, 0); + const POINT2D *pt_end = getPoint2d_cp(pa_end, pa_end->npoints-1); + if (!p2d_same(pt_start, pt_end)) + return LW_FALSE; } return LW_TRUE; @@ -84,12 +93,24 @@ lwcompound_is_valid(const LWCOMPOUND *compound) if (lwgeom_is_empty(lwcompound_as_lwgeom(compound))) return LW_TRUE; + /* Only one component, do not need to test connectivity */ + if (compound->ngeoms == 1) + return LW_TRUE; + + /* Check internal connectivity between components */ for (uint32_t i = 1; i < compound->ngeoms; i++) { - const LWLINE *geom_start = (LWLINE *)(compound->geoms[i]); - const LWLINE *geom_end = (LWLINE *)(compound->geoms[i-1]); - const POINTARRAY *pa_start = geom_start->points; - const POINTARRAY *pa_end = geom_end->points; + const POINTARRAY *pa_start, *pa_end; + const LWLINE *line_start = (LWLINE *)(compound->geoms[i]); + const LWLINE *line_end = (LWLINE *)(compound->geoms[i-1]); + + /* Empty cannot be a compound component, because it joins nothing */ + if (lwline_is_empty(line_start) || (lwline_is_empty(line_end))) + return LW_FALSE; + + pa_start = line_start->points; + pa_end = line_end->points; + if (hasz) { const POINT3D *pt_start = getPoint3d_cp(pa_start, 0); ----------------------------------------------------------------------- Summary of changes: liblwgeom/effectivearea.c | 13 ++++++-- liblwgeom/liblwgeom.h.in | 1 - liblwgeom/liblwgeom_internal.h | 1 - liblwgeom/lwalgorithm.c | 56 -------------------------------- liblwgeom/lwcompound.c | 72 ++++++++++++++++++++++++++++-------------- liblwgeom/lwstroke.c | 7 ++-- liblwgeom/measures3d.c | 3 ++ liblwgeom/ptarray.c | 5 ++- 8 files changed, 71 insertions(+), 87 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 00:27:52 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 07:27:52 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.def3c1640d79dcd456dff5bfa9b2b36b@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Wrong again: `GEOS_CoordSeq_isCCW` can still fail depending on where you start walking ( see https://woodie.osgeo.org/repos/30/pipeline/4273/83 and detail in https://github.com/libgeos/geos/issues/1425#issuecomment-4238347867 ) New attempt at fixing this problem ALSO on MacOS is dropping the dangling components when determining orientation. Experimental branch in that direction is in https://gitea.osgeo.org/postgis/postgis/pulls/292 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 14 00:30:00 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 00:30:00 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-452-g43af076ad Message-ID: <20260414073001.03F3719A020@trac.osgeo.org> 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 43af076ad4cf42a4fb1c12cb497425b958246c6f (commit) from 67999e2b1d2683ea14785e00e77070a2ced9aa7d (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 ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: topology/sql/manage/ValidateTopology.sql.in | 38 ++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 00:30:03 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 07:30:03 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.bf5187c4754dfe8aa3e303a486a5c2fb@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by Sandro Santilli ): In [changeset:"43af076ad4cf42a4fb1c12cb497425b958246c6f/git" 43af076/git]: {{{#!CommitTicketReference repository="git" revision="43af076ad4cf42a4fb1c12cb497425b958246c6f" Skip dangling parts of ring when computing orientation Improves robustness of telling shells apart shells from holes, without need for higher precision math in signed area computation. References #6067 for the ValidateTopology test ( ref #6065 ) }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 00:35:15 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 07:35:15 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.ad4bf7a26ecd851f72f68ce34919934b@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: fixed | Keywords: -----------------------+--------------------------- Changes (by strk): * resolution: => fixed * status: reopened => closed Comment: MacOS fix for this issue confirmed by CI here: https://cirrus-ci.com/task/5319076668506112?logs=test#L1979 > topology/test/regress/validatetopology .. ok in 256 ms Will only close this after the `long double` commit is reverted, to double-check. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 00:36:15 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 07:36:15 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.fcfa421a817ae3f5c8a8ef50c4bb808f@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Experimental algorithm update fixes the test for bug #6065 on MacOS: https ://cirrus-ci.com/task/5319076668506112?logs=test#L1979 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 01:34:05 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 08:34:05 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.c7734e7b8611fffdfcb332afac14c7a9@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by robe): Fixed validatetopology too on winnie, but I see the addlinestring one is still failing on both MacOS and winnie. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 06:38:06 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 13:38:06 -0000 Subject: [PostGIS] #6060: Fully qualify calls to postgis functions in plpgsql (was: Fully quality calls to postgis functions in plpgsql) In-Reply-To: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> References: <049.6b4e7fe4a1fc19f1fbe2f0abe6bf0708@osgeo.org> Message-ID: <064.7eb6d91e39773ab25c0077d9a9cd3e58@osgeo.org> #6060: Fully qualify calls to postgis functions in plpgsql ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------+--------------------------- Changes (by pramsey): * summary: Fully quality calls to postgis functions in plpgsql => Fully qualify calls to postgis functions in plpgsql -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 14 07:58:45 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 07:58:45 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-453-g9e9e4712a Message-ID: <20260414145846.16B491A1F01@trac.osgeo.org> 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 9e9e4712a448d71914aeaa2217f293a0349e4b8c (commit) from 43af076ad4cf42a4fb1c12cb497425b958246c6f (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 9e9e4712a448d71914aeaa2217f293a0349e4b8c Author: Sandro Santilli Date: Tue Apr 14 16:58:26 2026 +0200 Stop requesting address-standardizer from CI References #6053 diff --git a/.cirrus.yml b/.cirrus.yml index f51e66b2c..bf74e73ba 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -41,7 +41,7 @@ task: build_script: - | ./autogen.sh - ./configure PKG_CONFIG=/usr/local/bin/pkgconf CFLAGS="-isystem /usr/local/include -Wall -fno-omit-frame-pointer -Werror" LDFLAGS="-L/usr/local/lib" --with-libiconv-prefix=/usr/local --without-gui --with-topology --without-raster --with-sfcgal=/usr/local/bin/sfcgal-config --with-address-standardizer --with-protobuf + ./configure PKG_CONFIG=/usr/local/bin/pkgconf CFLAGS="-isystem /usr/local/include -Wall -fno-omit-frame-pointer -Werror" LDFLAGS="-L/usr/local/lib" --with-libiconv-prefix=/usr/local --without-gui --with-topology --without-raster --with-sfcgal=/usr/local/bin/sfcgal-config --with-protobuf service postgresql oneinitdb service postgresql onestart su postgres -c "createuser -s `whoami`" @@ -140,7 +140,6 @@ task: --with-topology \ --without-raster \ --with-sfcgal \ - --with-address-standardizer \ --with-protobuf \ --with-pgconfig=${PGCONFIG} diff --git a/ci/bessie32/postgis_regress.sh b/ci/bessie32/postgis_regress.sh index 82d86a6de..eba97ac78 100644 --- a/ci/bessie32/postgis_regress.sh +++ b/ci/bessie32/postgis_regress.sh @@ -17,7 +17,6 @@ sh autogen.sh --with-topology \ --with-raster \ --with-sfcgal=/usr/local/bin/sfcgal-config \ - --with-address-standardizer \ --with-protobuf \ --with-wagyu ----------------------------------------------------------------------- Summary of changes: .cirrus.yml | 3 +-- ci/bessie32/postgis_regress.sh | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 07:58:54 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 14:58:54 -0000 Subject: [PostGIS] #6053: Spin off address_standardizer as separate project In-Reply-To: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> References: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> Message-ID: <064.5f86f3ded0096df5f0ee081dd0096e51@osgeo.org> #6053: Spin off address_standardizer as separate project ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Sandro Santilli ): In [changeset:"9e9e4712a448d71914aeaa2217f293a0349e4b8c/git" 9e9e471/git]: {{{#!CommitTicketReference repository="git" revision="9e9e4712a448d71914aeaa2217f293a0349e4b8c" Stop requesting address-standardizer from CI References #6053 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 14 08:05:09 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 08:05:09 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-454-gc15f4e6f6 Message-ID: <20260414150509.569981A2601@trac.osgeo.org> 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 c15f4e6f6eee690a156171d97f48baf45cbc3fc4 (commit) from 9e9e4712a448d71914aeaa2217f293a0349e4b8c (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 c15f4e6f6eee690a156171d97f48baf45cbc3fc4 Author: Sandro Santilli Date: Tue Apr 14 17:04:43 2026 +0200 Drop Address Standardizer status from configure output References #6053 diff --git a/configure.ac b/configure.ac index 4c3e80693..e88df0d2a 100644 --- a/configure.ac +++ b/configure.ac @@ -1966,12 +1966,6 @@ else AC_MSG_RESULT([ SFCGAL support: disabled]) fi -if test "x$ADDRESS_STANDARDIZER" = "xaddress_standardizer"; then - AC_MSG_RESULT([ Address Standardizer support: enabled]) -else - AC_MSG_RESULT([ Address Standardizer support: disabled]) -fi - AC_MSG_RESULT() AC_MSG_RESULT([ -------- Documentation Generation -------- ]) AC_MSG_RESULT([ xsltproc: ${XSLTPROC}]) ----------------------------------------------------------------------- Summary of changes: configure.ac | 6 ------ 1 file changed, 6 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 08:05:10 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 15:05:10 -0000 Subject: [PostGIS] #6053: Spin off address_standardizer as separate project In-Reply-To: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> References: <049.f4d1eb5ea5ce334e1b08e74f1d6e7c99@osgeo.org> Message-ID: <064.890419e5526029f399f0ac6d9c78b997@osgeo.org> #6053: Spin off address_standardizer as separate project ----------------------+--------------------------- Reporter: pramsey | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: fixed | Keywords: ----------------------+--------------------------- Comment (by Sandro Santilli ): In [changeset:"c15f4e6f6eee690a156171d97f48baf45cbc3fc4/git" c15f4e6/git]: {{{#!CommitTicketReference repository="git" revision="c15f4e6f6eee690a156171d97f48baf45cbc3fc4" Drop Address Standardizer status from configure output References #6053 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 14 10:34:28 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 10:34:28 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-24-g49103cbdb Message-ID: <20260414173429.212891A40DA@trac.osgeo.org> 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.6 has been updated via 49103cbdbcbbcbb4772d549193d1baa8f1a7a63a (commit) from f02a7536cb3597d2db400fdd0e4747f03e29b6e2 (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 49103cbdbcbbcbb4772d549193d1baa8f1a7a63a Author: Paul Ramsey Date: Tue Apr 14 10:34:02 2026 -0700 Bug fixes from Maxim Korotkov diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index 6697186d8..2016bd20b 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -1823,6 +1823,13 @@ int lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed) { int modified = LW_FALSE; + + if (!geom) + { + lwerror("NULL geometry encountered"); + return LW_FALSE; + } + switch (geom->type) { /* No-op! Cannot simplify points or triangles */ diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 7f2df42c7..dbb0085c5 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -556,7 +556,6 @@ _lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, PGTOPO_BE_ERROR(); return -1; } - if ( foundInFace == -1 ) foundInFace = 0; } if ( face == -1 ) { ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwgeom.c | 7 +++++++ liblwgeom/topo/lwgeom_topo.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 10:34:32 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 10:34:32 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-455-g88169d2c5 Message-ID: <20260414173432.690621A471B@trac.osgeo.org> 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 88169d2c58bd48552512eeeeae5f6c8ecc71e22f (commit) from c15f4e6f6eee690a156171d97f48baf45cbc3fc4 (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 88169d2c58bd48552512eeeeae5f6c8ecc71e22f Author: Paul Ramsey Date: Tue Apr 14 10:34:02 2026 -0700 Bug fixes from Maxim Korotkov diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index b1a557feb..76b68e663 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -1893,6 +1893,13 @@ int lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed) { int modified = LW_FALSE; + + if (!geom) + { + lwerror("NULL geometry encountered"); + return LW_FALSE; + } + switch (geom->type) { /* No-op! Cannot simplify points or triangles */ diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 593a94ea8..7eeac3ea0 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -596,7 +596,6 @@ _lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, PGTOPO_BE_ERROR(); return -1; } - if ( foundInFace == -1 ) foundInFace = 0; } if ( face == -1 ) { ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwgeom.c | 7 +++++++ liblwgeom/topo/lwgeom_topo.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 10:34:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 10:34:51 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-23-gad1807281 Message-ID: <20260414173451.BB6F81A4CAA@trac.osgeo.org> 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.5 has been updated via ad1807281f5e9048e68077b1b98c8c51b37546ff (commit) from 396dc1bcc320bb69d15ff2ad74a5eeb4418e2ae2 (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 ad1807281f5e9048e68077b1b98c8c51b37546ff Author: Paul Ramsey Date: Tue Apr 14 10:34:02 2026 -0700 Bug fixes from Maxim Korotkov diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index 2e6d4e8a1..b1065c9b2 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -1807,6 +1807,13 @@ int lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed) { int modified = LW_FALSE; + + if (!geom) + { + lwerror("NULL geometry encountered"); + return LW_FALSE; + } + switch (geom->type) { /* No-op! Cannot simplify points or triangles */ diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 89db41fe5..65574f346 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -556,7 +556,6 @@ _lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, PGTOPO_BE_ERROR(); return -1; } - if ( foundInFace == -1 ) foundInFace = 0; } if ( face == -1 ) { ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwgeom.c | 7 +++++++ liblwgeom/topo/lwgeom_topo.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 10:35:06 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 10:35:06 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-25-g3fef397f3 Message-ID: <20260414173506.65B6E1A41B0@trac.osgeo.org> 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.4 has been updated via 3fef397f31b2d68b55683e8f4edfcc56fc7b7f2d (commit) from 399e2f18c249ea272ffefd974c110a4c69a213c4 (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 3fef397f31b2d68b55683e8f4edfcc56fc7b7f2d Author: Paul Ramsey Date: Tue Apr 14 10:34:02 2026 -0700 Bug fixes from Maxim Korotkov diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index 1dd07d5da..a302faebf 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -1760,6 +1760,13 @@ int lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed) { int modified = LW_FALSE; + + if (!geom) + { + lwerror("NULL geometry encountered"); + return LW_FALSE; + } + switch (geom->type) { /* No-op! Cannot simplify points or triangles */ diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c index 27900010f..b0363fe2d 100644 --- a/liblwgeom/lwgeom_topo.c +++ b/liblwgeom/lwgeom_topo.c @@ -561,7 +561,6 @@ _lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface)); return -1; } - if ( foundInFace == -1 ) foundInFace = 0; } if ( face == -1 ) { ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwgeom.c | 7 +++++++ liblwgeom/lwgeom_topo.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 10:35:23 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 10:35:23 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-23-g30dc5f866 Message-ID: <20260414173523.EF4D21A4790@trac.osgeo.org> 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.3 has been updated via 30dc5f866bb3ea028a7c9ace6f16a878f7f59cd3 (commit) from 102a01e1772da6bab7f00e10d3ba59bb4ad14257 (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 30dc5f866bb3ea028a7c9ace6f16a878f7f59cd3 Author: Paul Ramsey Date: Tue Apr 14 10:34:02 2026 -0700 Bug fixes from Maxim Korotkov diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index 78e352225..b6c2acf7f 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -1760,6 +1760,13 @@ int lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed) { int modified = LW_FALSE; + + if (!geom) + { + lwerror("NULL geometry encountered"); + return LW_FALSE; + } + switch (geom->type) { /* No-op! Cannot simplify points or triangles */ diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c index 584d99851..b2b4d0330 100644 --- a/liblwgeom/lwgeom_topo.c +++ b/liblwgeom/lwgeom_topo.c @@ -561,7 +561,6 @@ _lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface)); return -1; } - if ( foundInFace == -1 ) foundInFace = 0; } if ( face == -1 ) { ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwgeom.c | 7 +++++++ liblwgeom/lwgeom_topo.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 10:35:35 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 10:35:35 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-17-g7b00210ad Message-ID: <20260414173535.D5D561A4C74@trac.osgeo.org> 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.2 has been updated via 7b00210adf5c8071fcfe8556baa8b45b3cad1382 (commit) from b4ea0262f3fc1bcf4abaf49c3cd4f4d6d5eb802d (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 7b00210adf5c8071fcfe8556baa8b45b3cad1382 Author: Paul Ramsey Date: Tue Apr 14 10:34:02 2026 -0700 Bug fixes from Maxim Korotkov diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c index d367e65fd..f65cec8ca 100644 --- a/liblwgeom/lwgeom.c +++ b/liblwgeom/lwgeom.c @@ -1743,6 +1743,13 @@ int lwgeom_simplify_in_place(LWGEOM *geom, double epsilon, int preserve_collapsed) { int modified = LW_FALSE; + + if (!geom) + { + lwerror("NULL geometry encountered"); + return LW_FALSE; + } + switch (geom->type) { /* No-op! Cannot simplify points or triangles */ diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c index 88817eac1..782dc3d6d 100644 --- a/liblwgeom/lwgeom_topo.c +++ b/liblwgeom/lwgeom_topo.c @@ -555,7 +555,6 @@ _lwt_AddIsoNode( LWT_TOPOLOGY* topo, LWT_ELEMID face, lwerror("Backend error: %s", lwt_be_lastErrorMessage(topo->be_iface)); return -1; } - if ( foundInFace == -1 ) foundInFace = 0; } if ( face == -1 ) { ----------------------------------------------------------------------- Summary of changes: liblwgeom/lwgeom.c | 7 +++++++ liblwgeom/lwgeom_topo.c | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 10:41:32 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 17:41:32 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.e4b4382bf77f6e5157ed26ec71e222af@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Comment (by strk): It looks like on MacOS winding of a newly formed ring -4 is found to be counterclockwise even if we drop the dangling from the computation (on my system dropping the dangling changes that, and that ring is found clockwise instead): https://cirrus-ci.com/task/6517636818796544?logs=test#L1288 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 14 12:34:25 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 12:34:25 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.2-25-g3d1266658 Message-ID: <20260414193425.F2F2C1A60B6@trac.osgeo.org> 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.6 has been updated via 3d12666588a84b23a3147618eaa9b40b0fe5e796 (commit) from 49103cbdbcbbcbb4772d549193d1baa8f1a7a63a (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 3d12666588a84b23a3147618eaa9b40b0fe5e796 Author: Paul Ramsey Date: Tue Apr 14 12:12:45 2026 -0700 Prepare for 3.6.3 release diff --git a/NEWS b/NEWS index 022ab4bea..9065041dd 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ -PostGIS 3.6.3dev -2026/xx/xx +PostGIS 3.6.3 +2026/04/14 This version requires PostgreSQL 12-18, GEOS 3.8 or higher, and Proj 6.1+. To take advantage of all features, GEOS 3.14+ is needed. diff --git a/README.postgis b/README.postgis index 1a057a1af..3166952d6 100644 --- a/README.postgis +++ b/README.postgis @@ -1,8 +1,8 @@ PostGIS - Geographic Information Systems Extensions to PostgreSQL ================================================================= -:Version: 3.6.2 -:Date: 2026-02-09 +:Version: 3.6.3 +:Date: 2026-04-14 :Website: https://postgis.net This distribution contains a module which implements GIS simple features, ties diff --git a/Version.config b/Version.config index 7ac201024..e512f6475 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=6 -POSTGIS_MICRO_VERSION=3dev +POSTGIS_MICRO_VERSION=3 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/doc/release_notes.xml b/doc/release_notes.xml index f58ee5615..825f1839f 100644 --- a/doc/release_notes.xml +++ b/doc/release_notes.xml @@ -2,6 +2,24 @@ Appendix Release Notes + + +
+ PostGIS 3.6.3 + 2026/04/14 + + + Fixes + 6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + GH-850, Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + 6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) + 6060, fully quality calls to helper functions (Paul Ramsey) + 6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + 6061, WKT parser produces incorrect error locations (Paul Ramsey) + 6069, Build warnings / CI failures on K&R style, fallthroughs (Paul Ramsey) + +
+
PostGIS 3.6.2 2026/02/09 ----------------------------------------------------------------------- Summary of changes: NEWS | 4 ++-- README.postgis | 4 ++-- Version.config | 2 +- doc/release_notes.xml | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 12:34:25 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 12:34:25 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.5-24-g9aa71a8e5 Message-ID: <20260414193425.E93DD1A6294@trac.osgeo.org> 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.5 has been updated via 9aa71a8e5059959929825926db5ebefafde471db (commit) from ad1807281f5e9048e68077b1b98c8c51b37546ff (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 9aa71a8e5059959929825926db5ebefafde471db Author: Paul Ramsey Date: Tue Apr 14 12:14:10 2026 -0700 Prepare for 3.5.6 release diff --git a/NEWS b/NEWS index 23a96792c..2d4d1d74e 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ -PostGIS 3.5.6dev -2026/xx/xx +PostGIS 3.5.6 +2026/04/14 To take advantage of all postgis_sfcgal extension features SFCGAL 1.5+ is needed. PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required. diff --git a/README.postgis b/README.postgis index 671780f04..2b7efae2b 100644 --- a/README.postgis +++ b/README.postgis @@ -1,8 +1,8 @@ PostGIS - Geographic Information Systems Extensions to PostgreSQL ================================================================= -:Version: 3.5.5 -:Date: 2026-02-08 +:Version: 3.5.6 +:Date: 2026-04-14 :Website: https://postgis.net This distribution contains a module which implements GIS simple features, ties diff --git a/Version.config b/Version.config index ce3fc9869..6923fcc77 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=5 -POSTGIS_MICRO_VERSION=6dev +POSTGIS_MICRO_VERSION=6 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/doc/release_notes.xml b/doc/release_notes.xml index 0c80ce8f9..93d0f803b 100644 --- a/doc/release_notes.xml +++ b/doc/release_notes.xml @@ -3,6 +3,20 @@ Appendix Release Notes +
+ PostGIS 3.5.6 + 2026/04/14 + + Bug Fixes + 6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + GH-850, Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + 6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) + 6060, fully quality calls to helper functions (Paul Ramsey) + 6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + 6061, WKT parser produces incorrect error locations (Paul Ramsey) + +
+
PostGIS 3.5.5 2026/02/09 ----------------------------------------------------------------------- Summary of changes: NEWS | 4 ++-- README.postgis | 4 ++-- Version.config | 2 +- doc/release_notes.xml | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 12:34:26 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 12:34:26 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.5-26-g82fd454c4 Message-ID: <20260414193427.2606A1A612E@trac.osgeo.org> 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.4 has been updated via 82fd454c4ad58718a2f0adf647281bd0c74083ab (commit) from 3fef397f31b2d68b55683e8f4edfcc56fc7b7f2d (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 82fd454c4ad58718a2f0adf647281bd0c74083ab Author: Paul Ramsey Date: Tue Apr 14 12:14:20 2026 -0700 Prepare for 3.4.6 release diff --git a/NEWS b/NEWS index dce1d6bfe..9cc79ffc6 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ PostGIS 3.4.6 -2026/xx/xx +2026/04/14 PostgreSQL 12-17 required. GEOS 3.6+ required but GEOS 3.12+ to take advantage of all features. Proj 6.1+ required. diff --git a/README.postgis b/README.postgis index 403c399fa..f82ab56a7 100644 --- a/README.postgis +++ b/README.postgis @@ -1,8 +1,8 @@ PostGIS - Geographic Information Systems Extensions to PostgreSQL ================================================================= -:Version: 3.4.5 -:Date: 2026-02-09 +:Version: 3.4.6 +:Date: 2026-04-14 :Website: https://postgis.net This distribution contains a module which implements GIS simple features, ties diff --git a/Version.config b/Version.config index 133fc8a31..acf3ab6b4 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=4 -POSTGIS_MICRO_VERSION=6dev +POSTGIS_MICRO_VERSION=6 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/doc/release_notes.xml b/doc/release_notes.xml index d35d92cff..d44edbcfe 100644 --- a/doc/release_notes.xml +++ b/doc/release_notes.xml @@ -2,6 +2,22 @@ Appendix Release Notes + + + PostGIS 3.4.6 + 2026/04/14 + + + Bug Fixes + 6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + GH-850, Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + 6058, Use Pg composite_to_json() function in 19+ (Paul Ramsey) + 6060, fully quality calls to helper functions (Paul Ramsey) + 6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + 6061, WKT parser produces incorrect error locations (Paul Ramsey) + + + PostGIS 3.4.5 2025/02/09 ----------------------------------------------------------------------- Summary of changes: NEWS | 2 +- README.postgis | 4 ++-- Version.config | 2 +- doc/release_notes.xml | 16 ++++++++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 12:34:28 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 12:34:28 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.9-24-ga38d7f92c Message-ID: <20260414193428.ED2501A6480@trac.osgeo.org> 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.3 has been updated via a38d7f92cb88e23f4efd2088196ff73ff2f37de5 (commit) from 30dc5f866bb3ea028a7c9ace6f16a878f7f59cd3 (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 a38d7f92cb88e23f4efd2088196ff73ff2f37de5 Author: Paul Ramsey Date: Tue Apr 14 12:14:34 2026 -0700 Prepare for 3.3.10 release diff --git a/NEWS b/NEWS index bf3150120..b0e28922b 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ PostGIS 3.3.10 -2026-xx-xx +2026-04-14 * Bug Fixes and Enhancements * diff --git a/README.postgis b/README.postgis index a82ece9e8..86cbe3449 100644 --- a/README.postgis +++ b/README.postgis @@ -1,8 +1,8 @@ PostGIS - Geographic Information Systems Extensions to PostgreSQL ================================================================= -:Version: 3.3.9 -:Date: 2026-02-09 +:Version: 3.3.10 +:Date: 2026-04-14 :Website: https://postgis.net This distribution contains a module which implements GIS simple features, ties diff --git a/Version.config b/Version.config index 864c7ff22..348ca1f45 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=3 -POSTGIS_MICRO_VERSION=10dev +POSTGIS_MICRO_VERSION=10 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/doc/release_notes.xml b/doc/release_notes.xml index f277bc322..495f1f960 100644 --- a/doc/release_notes.xml +++ b/doc/release_notes.xml @@ -2,6 +2,21 @@ Appendix Release Notes + + + PostGIS 3.3.10 + 2026/04/14 + + Bug Fixes + 5998, [tiger_geododer] Do not create tiger_data as part of postgis_tiger_geocoder extension, create/update (Regina Obe) + 6055, Remove rare extension priv escalation case. Reported by Sven Klemm (Tiger Data), Allistair Ishmael Hakim (allistair.sh) and Daniel Bakker + GH-850, Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + 6060, fully quality calls to helper functions (Paul Ramsey) + 6026, KNN failure in rare IEEE double rounding case (Paul Ramsey) + 6061, WKT parser produces incorrect error locations (Paul Ramsey) + + + PostGIS 3.3.9 2026/02/09 ----------------------------------------------------------------------- Summary of changes: NEWS | 2 +- README.postgis | 4 ++-- Version.config | 2 +- doc/release_notes.xml | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 12:34:30 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 12:34:30 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.9-18-g77623525d Message-ID: <20260414193430.A30161A6145@trac.osgeo.org> 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.2 has been updated via 77623525d14500fe97f827597925bd0d95a871a8 (commit) from 7b00210adf5c8071fcfe8556baa8b45b3cad1382 (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 77623525d14500fe97f827597925bd0d95a871a8 Author: Paul Ramsey Date: Tue Apr 14 12:18:07 2026 -0700 Prepare for 3.2.10 release diff --git a/NEWS b/NEWS index 556664e47..dbfc296fd 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ -PostGIS 3.2.10dev -2026/xx/xx +PostGIS 3.2.10 +2026/04/14 PostgreSQL 9.6-15 required. GEOS 3.6+ required but GEOS 3.9+ to take advantage of all features. Proj 4.9+ required. diff --git a/README.postgis b/README.postgis index 1346a4491..3c35ebc55 100644 --- a/README.postgis +++ b/README.postgis @@ -1,8 +1,8 @@ PostGIS - Geographic Information Systems Extensions to PostgreSQL ================================================================= -:Version: 3.2.9 -:Date: 2028-02-08 +:Version: 3.2.10 +:Date: 2026-04-14 :Website: https://postgis.net This distribution contains a module which implements GIS simple features, ties diff --git a/Version.config b/Version.config index 315def4e5..8c8de69e6 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=2 -POSTGIS_MICRO_VERSION=10dev +POSTGIS_MICRO_VERSION=10 # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/doc/release_notes.xml b/doc/release_notes.xml index 0c5840ef0..3f6d67712 100644 --- a/doc/release_notes.xml +++ b/doc/release_notes.xml @@ -2,6 +2,20 @@ Appendix Release Notes + + + PostGIS 3.2.10 + 2026/04/14 + + Bug Fixes + 5998, [tiger_geododer] Do not create tiger_data as part of postgis_tiger_geocoder extension, create/update (Regina Obe) + 6054, Remove priv escalation scenario. Reported by Daniel Bakker + GH-850, Use quote_identifier to build tables in pgis_tablefromflatgeobuf (Ariel Mashraki) + 6060, fully quality calls to helper functions (Paul Ramsey) + 6061, WKT parser produces incorrect error locations (Paul Ramsey) + + + PostGIS 3.2.9 2026/02/08 ----------------------------------------------------------------------- Summary of changes: NEWS | 4 ++-- README.postgis | 4 ++-- Version.config | 2 +- doc/release_notes.xml | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 13:15:35 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 20:15:35 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.886a89b16afff5010c550a73885d86b5@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): The addLinestring one fails because this ring is found to be CounterClockwise on MacOS and Clockwise on my system: > 010200000005000000FD613B270D6C314031AA5436194751405D58985776943140195EE965DE47514085FFA6647B9F31408FC1C62B394851405D58985776943140195EE965DE475140FD613B270D6C314031AA543619475140 The ring is as component of an output of LineMerge. Is closed but self- intersects. I didn't expect such geometry to come out from LineMerge, sounds like a bug ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 13:59:53 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 20:59:53 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 Message-ID: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> #6071: ST_intersects fails for srid 3035 -------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Keywords: | -------------------------------+--------------------------- We have two objects that intersect in SRID 4258. The intersection area is not very small, but approximately 21.96131633594632. {{{ SELECT ST_area(ST_intersection( ST_transform(ST_SetSRID('0103000020DB0B000001000000050000001DBF0EB1DF4F514104447475EF7D5341112F8BDD854E51412DDFB3CF638D53411BE3F8F2525651411CF8786E038E5341E0AB8694B95751419CB58506907E53411DBF0EB1DF4F514104447475EF7D5341'::geometry, 3035),4258), ST_transform(ST_SetSRID('0103000020DB0B0000010000001E000000086879984555514154EEF8B95D7E5341F3BB2D3E465551419A5D6AB75C7E5341CDFEF858465551418E08FC6B5B7E5341D464B6F045555141F1BD3C2F5A7E5341D1D9AE48455551415361814C597E5341F0E7FA7944555141EED77BA6587E5341F0E7FA7944555141EED77BA6587E5341C1A0F1AF44555141223FC4CC577E5341C1A0F1AF44555141223FC4CC577E5341FDEF3EEE475551414CA0B94F587E5341056A0B4B4955514188FF7256587E534137DCC1DC4955514105356B91567E534137DCC1DC4955514105356B91567E5341312E151A4A555141FA90CC84557E5341312E151A4A555141FA90CC84557E5341E22B94504D5551411D733750567E53419C118C3452555141C434AF60577E534166D164EF55555141B09040ED577E534171EE750F59555141CC8126DD587E53413A4DD0615F55514194AA387C5A7E53413A4DD0615F55514194AA387C5A7E5341E2DAF2265F5551418CFD050A5B7E5341F8E4D65C5E55514173DEA6955C7E53413A9657E05D555141C20DD6E45D7E5341DAA090085C5551418E8FB4515E7E534108A0C74B5A5551412A4B86415E7E53419ED99C7A57555141369F0DCE5D7E5341D3E490795355514155680BEB5D7E5341F2D1AC1E4F555141A69091AA5D7E5341086879984555514154EEF8B95D7E5341'::geometry, 3035),4258) ),true) ; st_area ------------------- 21.96131633594632 (1 row) }}} Then try the same with SRID 3035 and zero area {{{ SELECT ST_area(ST_intersection( ST_SetSRID('0103000020DB0B000001000000050000001DBF0EB1DF4F514104447475EF7D5341112F8BDD854E51412DDFB3CF638D53411BE3F8F2525651411CF8786E038E5341E0AB8694B95751419CB58506907E53411DBF0EB1DF4F514104447475EF7D5341'::geometry, 3035), ST_SetSRID('0103000020DB0B0000010000001E000000086879984555514154EEF8B95D7E5341F3BB2D3E465551419A5D6AB75C7E5341CDFEF858465551418E08FC6B5B7E5341D464B6F045555141F1BD3C2F5A7E5341D1D9AE48455551415361814C597E5341F0E7FA7944555141EED77BA6587E5341F0E7FA7944555141EED77BA6587E5341C1A0F1AF44555141223FC4CC577E5341C1A0F1AF44555141223FC4CC577E5341FDEF3EEE475551414CA0B94F587E5341056A0B4B4955514188FF7256587E534137DCC1DC4955514105356B91567E534137DCC1DC4955514105356B91567E5341312E151A4A555141FA90CC84557E5341312E151A4A555141FA90CC84557E5341E22B94504D5551411D733750567E53419C118C3452555141C434AF60577E534166D164EF55555141B09040ED577E534171EE750F59555141CC8126DD587E53413A4DD0615F55514194AA387C5A7E53413A4DD0615F55514194AA387C5A7E5341E2DAF2265F5551418CFD050A5B7E5341F8E4D65C5E55514173DEA6955C7E53413A9657E05D555141C20DD6E45D7E5341DAA090085C5551418E8FB4515E7E534108A0C74B5A5551412A4B86415E7E53419ED99C7A57555141369F0DCE5D7E5341D3E490795355514155680BEB5D7E5341F2D1AC1E4F555141A69091AA5D7E5341086879984555514154EEF8B95D7E5341'::geometry, 3035) )) ; st_area --------- 0 (1 row) }}} A even simple intersects fails here. {{{ SELECT ST_intersects( ST_SetSRID('0103000020DB0B000001000000050000001DBF0EB1DF4F514104447475EF7D5341112F8BDD854E51412DDFB3CF638D53411BE3F8F2525651411CF8786E038E5341E0AB8694B95751419CB58506907E53411DBF0EB1DF4F514104447475EF7D5341'::geometry, 3035), ST_SetSRID('0103000020DB0B0000010000001E000000086879984555514154EEF8B95D7E5341F3BB2D3E465551419A5D6AB75C7E5341CDFEF858465551418E08FC6B5B7E5341D464B6F045555141F1BD3C2F5A7E5341D1D9AE48455551415361814C597E5341F0E7FA7944555141EED77BA6587E5341F0E7FA7944555141EED77BA6587E5341C1A0F1AF44555141223FC4CC577E5341C1A0F1AF44555141223FC4CC577E5341FDEF3EEE475551414CA0B94F587E5341056A0B4B4955514188FF7256587E534137DCC1DC4955514105356B91567E534137DCC1DC4955514105356B91567E5341312E151A4A555141FA90CC84557E5341312E151A4A555141FA90CC84557E5341E22B94504D5551411D733750567E53419C118C3452555141C434AF60577E534166D164EF55555141B09040ED577E534171EE750F59555141CC8126DD587E53413A4DD0615F55514194AA387C5A7E53413A4DD0615F55514194AA387C5A7E5341E2DAF2265F5551418CFD050A5B7E5341F8E4D65C5E55514173DEA6955C7E53413A9657E05D555141C20DD6E45D7E5341DAA090085C5551418E8FB4515E7E534108A0C74B5A5551412A4B86415E7E53419ED99C7A57555141369F0DCE5D7E5341D3E490795355514155680BEB5D7E5341F2D1AC1E4F555141A69091AA5D7E5341086879984555514154EEF8B95D7E5341'::geometry, 3035) ) ; st_intersects --------------- f (1 row) }}} This tested on {{{ POSTGIS="3.4.2 c19ce56" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1" (compiled against GEOS 3.10.2) SFCGAL="SFCGAL 1.4.1, CGAL 5.3.1, BOOST 1.74.0" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" GDAL="GDAL 3.4.1, released 2021/12/27" LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY RASTER POSTGIS="3.7.0dev 3.6.0rc2-305-g3b3488ddf" [EXTENSION] PGSQL="160" GEOS="3.14.0-CAPI-1.20.4" PROJ="9.7.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/Users/lop/Library/Application Support/proj DATABASE_PATH=/opt/homebrew/Cellar/proj/9.7.0/share/proj/proj.db" (compiled against PROJ 9.7.0) LIBXML="2.13.0" LIBJSON="0.18" TOPOLOGY POSTGIS="3.7.0dev 3.6.0rc2-435-g2c9277d3d" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 8.2.1) LIBXML="2.9.13" LIBJSON="0.15" LIBPROTOBUF="1.3.3" WAGYU="0.5.0 (Internal)" TOPOLOGY }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Tue Apr 14 16:26:19 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 16:26:19 -0700 (PDT) Subject: [SCM] postgis.net branch website updated. clarity-final-182-gd24e159 Message-ID: <20260414232621.323741A891C@trac.osgeo.org> 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.net". The branch, website has been updated via d24e1596fd09b8fb7a3bd5d04919907d67d2f474 (commit) from ad7a9fc7a906275bb67a58cf0399c16d2f6a4591 (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 d24e1596fd09b8fb7a3bd5d04919907d67d2f474 Author: Paul Ramsey Date: Tue Apr 14 16:26:12 2026 -0700 Add news for patch releases, 3.6.3 3.5.6 3.4.6 3.3.10 3.2.10 diff --git a/config.toml b/config.toml index ddf3d51..63cf194 100644 --- a/config.toml +++ b/config.toml @@ -170,24 +170,24 @@ enableRobotsTXT = true is_dev = true [params.postgis.releases.36] minor = "3.6" - dev = "3.6.3dev" - tag = "3.6.2" + dev = "3.6.4dev" + tag = "3.6.3" [params.postgis.releases.35] minor = "3.5" - dev = "3.5.6dev" - tag = "3.5.5" + dev = "3.5.7dev" + tag = "3.5.6" [params.postgis.releases.34] minor = "3.4" - dev = "3.4.6dev" - tag = "3.4.5" + dev = "3.4.7dev" + tag = "3.4.6" [params.postgis.releases.33] minor = "3.3" - dev = "3.3.10dev" - tag = "3.3.9" + dev = "3.3.11dev" + tag = "3.3.10" [params.postgis.releases.32] minor = "3.2" - dev = "3.2.10dev" - tag = "3.2.9" + dev = "3.2.11dev" + tag = "3.2.10" [params.postgis.releases.31] minor = "3.1" dev = "3.1.13" diff --git a/content/news/2026/04-14_postgis-patches.md b/content/news/2026/04-14_postgis-patches.md new file mode 100644 index 0000000..8385934 --- /dev/null +++ b/content/news/2026/04-14_postgis-patches.md @@ -0,0 +1,24 @@ +--- +title: PostGIS Patch Releases +layout: post +category: news +tags: [release,3.6,3.5,3.4,3.3,3.2] +author: Paul Ramsey +date: "2026-04-14" +thumbnail: +--- + +The PostGIS development team is pleased to provide +[bug fix and security releases](/source) for +PostGIS 3.2 - 3.6. + + + +* **3.6.3** [source]({{< loc "postgis.release_source">}}/postgis-3.6.3.tar.gz) [md5]({{< loc "postgis.dev_download">}}/postgis-3.6.3.tar.gz.md5) [NEWS](https://git.osgeo.org/postgis/postgis/raw/tag/3.6.3/NEWS) docs: [en]({{< loc "postgis.release_docs">}}/postgis-3.6.3-en.pdf) +* **3.5.6** [source]({{< loc "postgis.release_source">}}/postgis-3.5.6.tar.gz) [md5]({{< loc "postgis.dev_download">}}/postgis-3.5.6.tar.gz.md5) [NEWS](https://git.osgeo.org/postgis/postgis/raw/tag/3.5.6/NEWS) docs: [en]({{< loc "postgis.release_docs">}}/postgis-3.5.6-en.pdf) +* **3.4.6** [source]({{< loc "postgis.release_source">}}/postgis-3.4.6.tar.gz) [md5]({{< loc "postgis.dev_download">}}/postgis-3.4.6.tar.gz.md5) [NEWS](https://git.osgeo.org/postgis/postgis/raw/tag/3.4.6/NEWS) docs: [en]({{< loc "postgis.release_docs">}}/postgis-3.4.6-en.pdf) +* **3.3.10** [source]({{< loc "postgis.release_source">}}/postgis-3.3.10.tar.gz) [md5]({{< loc "postgis.dev_download">}}/postgis-3.3.10.tar.gz.md5) [NEWS](https://git.osgeo.org/postgis/postgis/raw/tag/3.3.10/NEWS) docs: [en]({{< loc "postgis.release_docs">}}/postgis-3.3.10.pdf) +* **3.2.10** [source]({{< loc "postgis.release_source">}}/postgis-3.2.10.tar.gz) [md5]({{< loc "postgis.dev_download">}}/postgis-3.2.10.tar.gz.md5) [NEWS](https://git.osgeo.org/postgis/postgis/raw/tag/3.2.10/NEWS) docs: [en]({{< loc "postgis.release_docs">}}/postgis-3.2.10.pdf) + + +Please refer to the links above for more information about the issues resolved by these releases. ----------------------------------------------------------------------- Summary of changes: config.toml | 20 ++++++++++---------- content/news/2026/04-14_postgis-patches.md | 24 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 content/news/2026/04-14_postgis-patches.md hooks/post-receive -- postgis.net From git at osgeo.org Tue Apr 14 16:34:10 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 16:34:10 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.6 updated. 3.6.3-1-g146713b10 Message-ID: <20260414233411.141881A8738@trac.osgeo.org> 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.6 has been updated via 146713b10690d84328e7bc01d176728c7db23798 (commit) from 3d12666588a84b23a3147618eaa9b40b0fe5e796 (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 146713b10690d84328e7bc01d176728c7db23798 Author: Paul Ramsey Date: Tue Apr 14 16:34:08 2026 -0700 Bump to development 3.6.4 diff --git a/NEWS b/NEWS index 9065041dd..769000fe3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +PostGIS 3.6.4 +2026/xx/xx + +* Fixes * + +- + + PostGIS 3.6.3 2026/04/14 diff --git a/Version.config b/Version.config index e512f6475..d2ae378e9 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=6 -POSTGIS_MICRO_VERSION=3 +POSTGIS_MICRO_VERSION=4dev # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk index ec5a31885..8524ac3c2 100644 --- a/extensions/upgradeable_versions.mk +++ b/extensions/upgradeable_versions.mk @@ -121,4 +121,5 @@ UPGRADEABLE_VERSIONS = \ 3.5.5 \ 3.6.0 \ 3.6.1 \ - 3.6.2 + 3.6.2 \ + 3.6.3 ----------------------------------------------------------------------- Summary of changes: NEWS | 8 ++++++++ Version.config | 2 +- extensions/upgradeable_versions.mk | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 16:34:30 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 16:34:30 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.5 updated. 3.5.6-1-g0f83064d6 Message-ID: <20260414233430.AC76A1A88CD@trac.osgeo.org> 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.5 has been updated via 0f83064d660300256e043ff55c44320d25b9ad42 (commit) from 9aa71a8e5059959929825926db5ebefafde471db (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 0f83064d660300256e043ff55c44320d25b9ad42 Author: Paul Ramsey Date: Tue Apr 14 16:34:28 2026 -0700 Bump to development 3.5.7dev diff --git a/NEWS b/NEWS index 2d4d1d74e..5382dc191 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +PostGIS 3.5.7 +2026/xx/xx + +* Bug Fixes * + + - + + PostGIS 3.5.6 2026/04/14 diff --git a/Version.config b/Version.config index 6923fcc77..8057027e3 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=5 -POSTGIS_MICRO_VERSION=6 +POSTGIS_MICRO_VERSION=7dev # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk index ec284faab..85085daee 100644 --- a/extensions/upgradeable_versions.mk +++ b/extensions/upgradeable_versions.mk @@ -118,4 +118,5 @@ UPGRADEABLE_VERSIONS = \ 3.5.2 \ 3.5.3 \ 3.5.4 \ - 3.5.5 + 3.5.5 \ + 3.5.6 ----------------------------------------------------------------------- Summary of changes: NEWS | 8 ++++++++ Version.config | 2 +- extensions/upgradeable_versions.mk | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 16:34:43 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 16:34:43 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.4 updated. 3.4.6-1-gec07cfaaf Message-ID: <20260414233444.0161D1A8B06@trac.osgeo.org> 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.4 has been updated via ec07cfaaf0e0a430c3e60a4d1e78570fb070e1a6 (commit) from 82fd454c4ad58718a2f0adf647281bd0c74083ab (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 ec07cfaaf0e0a430c3e60a4d1e78570fb070e1a6 Author: Paul Ramsey Date: Tue Apr 14 16:34:42 2026 -0700 Bump to development 3.4.7dev diff --git a/NEWS b/NEWS index 9cc79ffc6..96c49e5f3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +PostGIS 3.4.7 +2026/xx/xx + +* Bug Fixes * + + - + + PostGIS 3.4.6 2026/04/14 diff --git a/Version.config b/Version.config index acf3ab6b4..f4d6a1753 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=4 -POSTGIS_MICRO_VERSION=6 +POSTGIS_MICRO_VERSION=7dev # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk index 3d54cdb3e..c13393da9 100644 --- a/extensions/upgradeable_versions.mk +++ b/extensions/upgradeable_versions.mk @@ -111,4 +111,5 @@ UPGRADEABLE_VERSIONS = \ 3.4.2 \ 3.4.3 \ 3.4.4 \ - 3.4.5 + 3.4.5 \ + 3.4.6 ----------------------------------------------------------------------- Summary of changes: NEWS | 8 ++++++++ Version.config | 2 +- extensions/upgradeable_versions.mk | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 16:34:50 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 16:34:50 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.3 updated. 3.3.10-1-ge7e8de1c2 Message-ID: <20260414233450.73A061A866B@trac.osgeo.org> 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.3 has been updated via e7e8de1c250fffd31041201fbf31f7b0c77a0f57 (commit) from a38d7f92cb88e23f4efd2088196ff73ff2f37de5 (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 e7e8de1c250fffd31041201fbf31f7b0c77a0f57 Author: Paul Ramsey Date: Tue Apr 14 16:34:48 2026 -0700 Bump to development 3.3.11dev diff --git a/NEWS b/NEWS index b0e28922b..2dbea618c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +PostGIS 3.3.11 +2026-xx-xx + +* Bug Fixes and Enhancements * + + - + + PostGIS 3.3.10 2026-04-14 diff --git a/Version.config b/Version.config index 348ca1f45..72862b81d 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=3 -POSTGIS_MICRO_VERSION=10 +POSTGIS_MICRO_VERSION=11dev # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk index 398a51e3f..4c5d5700a 100644 --- a/extensions/upgradeable_versions.mk +++ b/extensions/upgradeable_versions.mk @@ -105,4 +105,5 @@ UPGRADEABLE_VERSIONS = \ 3.3.6 \ 3.3.7 \ 3.3.8 \ - 3.3.9 + 3.3.9 \ + 3.3.10 ----------------------------------------------------------------------- Summary of changes: NEWS | 8 ++++++++ Version.config | 2 +- extensions/upgradeable_versions.mk | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Tue Apr 14 16:34:55 2026 From: git at osgeo.org (git at osgeo.org) Date: Tue, 14 Apr 2026 16:34:55 -0700 (PDT) Subject: [SCM] PostGIS branch stable-3.2 updated. 3.2.10-1-ga1619cc86 Message-ID: <20260414233455.753871A873A@trac.osgeo.org> 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.2 has been updated via a1619cc86506cbfc91695db0e80303603b0cdd9a (commit) from 77623525d14500fe97f827597925bd0d95a871a8 (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 a1619cc86506cbfc91695db0e80303603b0cdd9a Author: Paul Ramsey Date: Tue Apr 14 16:34:53 2026 -0700 Bump to development 3.2.11dev diff --git a/NEWS b/NEWS index dbfc296fd..e45159ecb 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,11 @@ +PostGIS 3.2.11 +2026/xx/xx + +* Bug Fixes * + + - + + PostGIS 3.2.10 2026/04/14 diff --git a/Version.config b/Version.config index 8c8de69e6..ea163f4bf 100644 --- a/Version.config +++ b/Version.config @@ -5,7 +5,7 @@ POSTGIS_MAJOR_VERSION=3 POSTGIS_MINOR_VERSION=2 -POSTGIS_MICRO_VERSION=10 +POSTGIS_MICRO_VERSION=11dev # Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev) # when changing POSTGIS_MINOR_VERSION diff --git a/extensions/upgradeable_versions.mk b/extensions/upgradeable_versions.mk index d8fcf3ac6..6f9ab1161 100644 --- a/extensions/upgradeable_versions.mk +++ b/extensions/upgradeable_versions.mk @@ -95,4 +95,5 @@ UPGRADEABLE_VERSIONS = \ 3.2.6 \ 3.2.7 \ 3.2.8 \ - 3.2.9 + 3.2.9 \ + 3.2.10 ----------------------------------------------------------------------- Summary of changes: NEWS | 8 ++++++++ Version.config | 2 +- extensions/upgradeable_versions.mk | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Tue Apr 14 16:54:01 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 23:54:01 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 In-Reply-To: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> References: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> Message-ID: <065.9bbe32f9bbe250d08ff70a2fc0ad8a57@osgeo.org> #6071: ST_intersects fails for srid 3035 --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by pramsey): * Attachment "Screenshot 2026-04-14 at 4.53.20?PM.png" added. zoom1 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 16:54:11 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 23:54:11 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 In-Reply-To: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> References: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> Message-ID: <065.8876b27f480bcf3f630bb84f9546859d@osgeo.org> #6071: ST_intersects fails for srid 3035 --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by pramsey): * Attachment "Screenshot 2026-04-14 at 4.53.34?PM.png" added. zoom2 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 16:54:20 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 23:54:20 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 In-Reply-To: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> References: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> Message-ID: <065.d42de52f8cb39efd22c6b8d37acebc53@osgeo.org> #6071: ST_intersects fails for srid 3035 --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: | Keywords: --------------------------------+--------------------------- Changes (by pramsey): * Attachment "Screenshot 2026-04-14 at 4.53.43?PM.png" added. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 16:54:55 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 23:54:55 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 In-Reply-To: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> References: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> Message-ID: <065.d2c85bf1c7915815469fb7778ced3cf2@osgeo.org> #6071: ST_intersects fails for srid 3035 --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: invalid | Keywords: --------------------------------+--------------------------- Changes (by pramsey): * resolution: => invalid * status: new => closed Comment: Projections have consequences, see attached pictures. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 14 16:56:40 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 14 Apr 2026 23:56:40 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.f7e2fbb10c441aaf37d1844e09e78482@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by pramsey): Dunno if LineMerge offers any guarantees, but I agree it feels outside the expected contract. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 15 00:18:10 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 07:18:10 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.6af7197c26fd26c940be0e60ea25ecdc@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Good news: it was a bug in my dangling-skip implementation. Seems to work now, including without long-double. I'll cleanup and merge today. !LineMerge was good, given the inputs (but yes, it can return non-simple components if inputs were non-simple) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 15 00:36:57 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 15 Apr 2026 00:36:57 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-457-gcfb81e6a5 Message-ID: <20260415073657.C755A1ABA3F@trac.osgeo.org> 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 cfb81e6a5bf761b6603a6425e689d82d5f3b046c (commit) via 00440ad2900ced28817d18e4908a13bff455588a (commit) from 88169d2c58bd48552512eeeeae5f6c8ecc71e22f (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 cfb81e6a5bf761b6603a6425e689d82d5f3b046c Author: Sandro Santilli Date: Tue Apr 14 17:30:42 2026 +0200 Revert use of long double Effectively reverting 7e3d523cda37faa3efdb8daed91e73df6a9fe864 diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 65b72290b..5c6796e75 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1083,7 +1083,7 @@ ptarray_signed_area(const POINTARRAY *pa) const POINT2D *P1; const POINT2D *P2; const POINT2D *P3; - long double sum = 0.0; + double sum = 0.0; double x0, x, y1, y2; uint32_t i; commit 00440ad2900ced28817d18e4908a13bff455588a Author: Sandro Santilli Date: Tue Apr 14 09:58:48 2026 +0200 Skip dangling edges while computing ring orientation in liblwgeom-topo Improves CCW determination robustness, passing tests on all CI platforms Closes #6067, #6064 diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 7eeac3ea0..0faec58e5 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -1878,27 +1878,38 @@ _lwt_GetInteriorEdgePoint(const LWLINE* edge, POINT2D* ip) return 1; } +/* + * @param isccw will be set to 1 if the ring is CounterClockwise, 0 otherwise + * @param ringbox if not null will be set to the bounding box of the ring + * + */ static LWPOLY * -_lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num_signed_edge_ids) +_lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num_signed_edge_ids, int *isccw, GBOX *ringbox) { LWT_ELEMID *edge_ids; - uint64_t numedges, i, j; + LWT_ELEMID *dangling_edge_ids; + uint64_t numedges, num_dangling, j, i; LWT_ISO_EDGE *ring_edges; /* Construct a polygon using edges of the ring */ numedges = 0; + num_dangling = 0; edge_ids = lwalloc(sizeof(LWT_ELEMID)*num_signed_edge_ids); + dangling_edge_ids = lwalloc(sizeof(LWT_ELEMID)*num_signed_edge_ids); for (i=0; ipoints, &edgebox) ) + { + lwfree( dangling_edge_ids ); + lwerror("Could not calculate bounding box of edge %" LWTFMT_ELEMID, ring_edges[i].edge_id); + return NULL; + } + if ( 0 == i ) gbox_duplicate(&edgebox, ringbox); + else gbox_merge(&edgebox, ringbox); + } + } + /* Should now build a polygon with those edges, in the order * given by GetRingEdges. */ - POINTARRAY *pa = NULL; + LWCOLLECTION *non_dangling_collection = NULL; + POINTARRAY *full_ring_pa = NULL; for ( i=0; igeom->points); - if ( eid < 0 ) ptarray_reverse_in_place(pa); + full_ring_pa = ptarray_clone_deep(edge->geom->points); + if ( eid < 0 ) ptarray_reverse_in_place(full_ring_pa); } else { @@ -1954,24 +1987,125 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num { epa = ptarray_clone_deep(edge->geom->points); ptarray_reverse_in_place(epa); - ptarray_append_ptarray(pa, epa, 0); + ptarray_append_ptarray(full_ring_pa, epa, 0); ptarray_free(epa); } else { /* avoid a clone here */ - ptarray_append_ptarray(pa, edge->geom->points, 0); + ptarray_append_ptarray(full_ring_pa, edge->geom->points, 0); } } + + int found = 0; + for ( j=0; jedge_id ) + { + found = 1; + break; + } + } + if ( found ) + { + LWDEBUGF(2, "Edge %" LWTFMT_ELEMID " is dangling (index %" PRIu64 ")", edge->edge_id, j); + continue; + } + + if ( non_dangling_collection == NULL ) + { + non_dangling_collection = lwcollection_construct_empty( + COLLECTIONTYPE, + topo->srid, + topo->hasZ, + 0 + ); + } + POINTARRAY *pa_toadd = ptarray_clone_deep(edge->geom->points); + if ( eid < 0 ) + { + ptarray_reverse_in_place(pa_toadd); + } + lwcollection_add_lwgeom( + non_dangling_collection, + lwline_as_lwgeom(lwline_construct(topo->srid, NULL, pa_toadd)) + ); } + lwfree( dangling_edge_ids ); _lwt_release_edges(ring_edges, numedges); + + if ( ! ptarray_is_closed_2d(full_ring_pa) ) + { + lwerror("Corrupted topology: ring of edge %" LWTFMT_ELEMID + " is geometrically not-closed", signed_edge_ids[0]); + return NULL; + } + + if ( non_dangling_collection == NULL ) /* all edges are dangling ! */ + { + lwnotice("All edges in ring are dangling, will not report as ccw"); + *isccw = 0; + } + + LWGEOM *merged = lwgeom_linemerge(lwcollection_as_lwgeom(non_dangling_collection)); + lwcollection_free(non_dangling_collection); + + LWDEBUGG(2, merged, "Linemerged non-dangling edges"); + + switch (merged->type) + { + case LINETYPE: + { + LWLINE *line = (LWLINE *)(merged); + POINTARRAY *pa = line->points; + *isccw = ptarray_isccw(pa); + break; + } + case MULTILINETYPE: + { + double maxarea = 0; + LWMLINE *mline = (LWMLINE *)(merged); + /* find the one with the largest area */ + for ( i=0; ingeoms; ++i ) + { + const LWLINE *l = mline->geoms[i]; + const POINTARRAY *pa = l->points; + double sarea; + + /* skip non-closed rings */ + //if ( ! ptarray_is_closed_2d(pa) ) continue; + + sarea = ptarray_signed_area(pa); + LWDEBUGF(3, "Signed area of ring %" PRIu64 ": %g", i, sarea); + if ( fabs(sarea) > fabs(maxarea) ) { + maxarea = sarea; + } + } + LWDEBUGF(2, "Maxarea: %g", maxarea); + *isccw = maxarea < 0 ? 1 : 0; + break; + } + default: + { + lwerror("%s: Unexpected geometry type from lwgeom_linemerge: %s", __func__, lwtype_name(merged->type)); + return NULL; + } + } + + POINTARRAY **points = lwalloc(sizeof(POINTARRAY*)); - points[0] = pa; + points[0] = full_ring_pa; /* NOTE: the ring may very well have collapsed components, * which would make it topologically invalid */ LWPOLY* shell = lwpoly_construct(0, 0, 1, points); +#if POSTGIS_DEBUG_LEVEL > 0 + if ( ptarray_isccw(shell->rings[0]) != *isccw ) + { + LWDEBUGF(1, "CCW disagreement on signed edge id %" LWTFMT_ELEMID, signed_edge_ids[0]); + } +#endif return shell; } @@ -2035,28 +2169,21 @@ _lwt_AddFaceSplit( LWT_TOPOLOGY* topo, * NOTE: this possibly includes dangling edges * */ + int isccw = 0; + GBOX ringbox; LWPOLY *shell = _lwt_MakeRingShell(topo, signed_edge_ids, - num_signed_edge_ids); + num_signed_edge_ids, &isccw, &ringbox); if ( ! shell ) { lwfree( signed_edge_ids ); /* ring_edges should be NULL */ lwerror("Could not create ring shell: %s", lwt_be_lastErrorMessage(topo->be_iface)); return -2; } - const POINTARRAY *pa = shell->rings[0]; - if ( ! ptarray_is_closed_2d(pa) ) - { - lwpoly_free(shell); - lwfree( signed_edge_ids ); - lwerror("Corrupted topology: ring of edge %" LWTFMT_ELEMID - " is geometrically not-closed", sedge); - return -2; - } - - int isccw = ptarray_isccw(pa); LWDEBUGF(1, "Ring of edge %" LWTFMT_ELEMID " is %sclockwise", sedge, isccw ? "counter" : ""); - const GBOX* shellbox = lwgeom_get_bbox(lwpoly_as_lwgeom(shell)); + + const GBOX* shellbox = &ringbox; + const POINTARRAY *pa = shell->rings[0]; if ( face == 0 ) { @@ -3583,26 +3710,8 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom) } LWDEBUGF(1, "getRingEdges returned %" PRIu64 " edges", num_signed_edge_ids); - shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids); - if ( ! shell ) { - lwfree( signed_edge_ids ); - /* ring_edges should be NULL */ - lwerror("Could not create ring shell: %s", lwt_be_lastErrorMessage(topo->be_iface)); - return -1; - } - - const POINTARRAY *pa = shell->rings[0]; - if ( ! ptarray_is_closed_2d(pa) ) - { - lwpoly_free(shell); - lwfree( signed_edge_ids ); - lwerror("Corrupted topology: ring of edge %" LWTFMT_ELEMID - " is geometrically not-closed", edge_id); - return -1; - } - - leftRingIsCCW = ptarray_isccw(pa); - lwpoly_free(shell); + shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids, &leftRingIsCCW, NULL); + lwpoly_free(shell); /* TODO: don't build it at all */ lwfree( signed_edge_ids ); LWDEBUGF(1, "Ring of edge %" LWTFMT_ELEMID " is %sclockwise", edge_id, leftRingIsCCW ? "counter" : ""); @@ -3687,26 +3796,8 @@ lwt_ChangeEdgeGeom(LWT_TOPOLOGY* topo, LWT_ELEMID edge_id, LWLINE *geom) } LWDEBUGF(1, "getRingEdges returned %" PRIu64 " edges", num_signed_edge_ids); - shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids); - if ( ! shell ) { - lwfree( signed_edge_ids ); - /* ring_edges should be NULL */ - lwerror("Could not create ring shell: %s", lwt_be_lastErrorMessage(topo->be_iface)); - return -1; - } - - const POINTARRAY *pa = shell->rings[0]; - if ( ! ptarray_is_closed_2d(pa) ) - { - lwpoly_free(shell); - lwfree( signed_edge_ids ); - lwerror("Corrupted topology: ring of edge %" LWTFMT_ELEMID - " is geometrically not-closed", edge_id); - return -1; - } - - isCCW = ptarray_isccw(pa); - lwpoly_free(shell); + shell = _lwt_MakeRingShell(topo, signed_edge_ids, num_signed_edge_ids, &isCCW, NULL); + lwpoly_free(shell); /* TODO: don't build it at all */ lwfree( signed_edge_ids ); if ( isCCW != leftRingIsCCW ) ----------------------------------------------------------------------- Summary of changes: liblwgeom/ptarray.c | 2 +- liblwgeom/topo/lwgeom_topo.c | 221 ++++++++++++++++++++++++++++++------------- 2 files changed, 157 insertions(+), 66 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 15 00:36:59 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 07:36:59 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.47c710da1de81a1cefe758c5575b538f@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: fixed | Keywords: -----------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: new => closed Comment: In [changeset:"00440ad2900ced28817d18e4908a13bff455588a/git" 00440ad/git]: {{{#!CommitTicketReference repository="git" revision="00440ad2900ced28817d18e4908a13bff455588a" Skip dangling edges while computing ring orientation in liblwgeom-topo Improves CCW determination robustness, passing tests on all CI platforms Closes #6067, #6064 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 15 00:36:59 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 07:36:59 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.79c1281e9417553447eee31d45ff2202@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: Component: topology | Version: master Resolution: fixed | Keywords: robustness -----------------------+------------------------ Changes (by Sandro Santilli ): * resolution: => fixed * status: reopened => closed Comment: In [changeset:"00440ad2900ced28817d18e4908a13bff455588a/git" 00440ad/git]: {{{#!CommitTicketReference repository="git" revision="00440ad2900ced28817d18e4908a13bff455588a" Skip dangling edges while computing ring orientation in liblwgeom-topo Improves CCW determination robustness, passing tests on all CI platforms Closes #6067, #6064 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 15 00:43:05 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 07:43:05 -0000 Subject: [PostGIS] #5180: Batch edges removal function In-Reply-To: <046.ddc64c3d7abeb0f46be2e25390beb522@osgeo.org> References: <046.ddc64c3d7abeb0f46be2e25390beb522@osgeo.org> Message-ID: <061.9d724f69bd6592819a916114185348db@osgeo.org> #5180: Batch edges removal function --------------------------+----------------------------- Reporter: strk | Owner: strk Type: enhancement | Status: new Priority: medium | Milestone: PostGIS Fund Me Component: topology | Version: Resolution: | Keywords: --------------------------+----------------------------- Comment (by Lars Aksel Opsahl): This seems to work nicely now. I am testing with a copy of your code, like this: [https://gitlab.com/nibioopensource/resolve-overlap-and- gap/-/blob/develop/src/main/sql/function_remove_edges.sql] but I wonder if it would also be nice to return faces that are collapsed/removed, and not only the newly created ones ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 15 00:57:57 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 15 Apr 2026 00:57:57 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-458-g8b5d974cb Message-ID: <20260415075757.F022F1ACC21@trac.osgeo.org> 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 8b5d974cb7f4376c5ebc9936b5ba93aaf826452c (commit) from cfb81e6a5bf761b6603a6425e689d82d5f3b046c (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 8b5d974cb7f4376c5ebc9936b5ba93aaf826452c Author: Sandro Santilli Date: Wed Apr 15 09:57:19 2026 +0200 Add proper --help support in run_test.pl So you can get the usage string on stdout when that's what you're asking for diff --git a/regress/run_test.pl b/regress/run_test.pl index c3b5d0827..2e1c625f5 100755 --- a/regress/run_test.pl +++ b/regress/run_test.pl @@ -95,10 +95,12 @@ my $OPT_UPGRADE_PATH = ''; our $OPT_UPGRADE_FROM = ''; my $OPT_UPGRADE_TO = ''; our $VERBOSE = 0; +my $ASKED_FOR_HELP = 0; our $OPT_SCHEMA = 'public'; GetOptions ( 'verbose+' => \$VERBOSE, + 'help' => \$ASKED_FOR_HELP, 'clean' => \$OPT_CLEAN, 'nodrop' => \$OPT_NODROP, 'upgrade+' => \$OPT_UPGRADE, @@ -124,9 +126,16 @@ GetOptions ( 'after-restore-script=s' => \@OPT_HOOK_AFTER_RESTORE ); +if ( $ASKED_FOR_HELP > 0 ) +{ + usage(*STDOUT{IO}); + exit 0; +} + if ( @ARGV < 1 ) { - usage(); + usage(*STDERR{IO}); + exit 1; } sub findOrDie @@ -709,9 +718,9 @@ exit($FAIL); sub usage { - die qq{ -Usage: $0 [] [] + print { shift } qq{Usage: $0 [] [] Options: + --help print these instructionss -v, --verbose be verbose about failures --nocreate do not create the regression database on start --upgrade upgrade db before running tests, can be passed ----------------------------------------------------------------------- Summary of changes: regress/run_test.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 15 04:05:52 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 11:05:52 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 In-Reply-To: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> References: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> Message-ID: <065.93f99692514bf725adb0e1c1e4c99edd@osgeo.org> #6071: ST_intersects fails for srid 3035 --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: invalid | Keywords: --------------------------------+--------------------------- Comment (by Lars Aksel Opsahl): Thanks, I thought those glitches were a GUI issue in QGIS. I may try testing with higher?density of points to see whether that has an effect on this issue. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 15 08:21:53 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 15:21:53 -0000 Subject: [PostGIS] #6071: ST_intersects fails for srid 3035 In-Reply-To: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> References: <050.1cce9039929e76fd9d13aeaeae299e93@osgeo.org> Message-ID: <065.b88141ec5eca6f840a79ebb4a12faf04@osgeo.org> #6071: ST_intersects fails for srid 3035 --------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.3 Component: postgis | Version: 3.6.x Resolution: invalid | Keywords: --------------------------------+--------------------------- Comment (by pramsey): Densifying will certainly help, but note that doing so will carry the assumptions of the space within which you densify. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Wed Apr 15 08:50:38 2026 From: git at osgeo.org (git at osgeo.org) Date: Wed, 15 Apr 2026 08:50:38 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-461-ge21fe0083 Message-ID: <20260415155038.9DEA21B21A0@trac.osgeo.org> 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 e21fe0083bd1fdd7477e60162b793870f8b536fc (commit) via 83ba9c60da7d47e936848eb2a764b23e53c37598 (commit) via 5e3b36d6ab3cd2c1c1191ac95257332fef0e9e1b (commit) from 8b5d974cb7f4376c5ebc9936b5ba93aaf826452c (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 e21fe0083bd1fdd7477e60162b793870f8b536fc Author: Sandro Santilli Date: Wed Apr 15 17:42:00 2026 +0200 Revert "Skip dangling parts of ring when computing orientation" This reverts commit 43af076ad4cf42a4fb1c12cb497425b958246c6f. The implementation fails for CCW rings with holes touching the ring diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in index 9bedb0654..4dff69603 100644 --- a/topology/sql/manage/ValidateTopology.sql.in +++ b/topology/sql/manage/ValidateTopology.sql.in @@ -468,8 +468,7 @@ BEGIN SELECT r.ring_id, e.seq, - e.edge signed_edge_id, - count(e.edge) over (PARTITION BY ring_id, abs(e.edge)) > 1 as dangling + e.edge signed_edge_id FROM all_rings r LEFT JOIN LATERAL unnest(r.edges) WITH ORDINALITY AS e(edge, seq) ON TRUE @@ -483,16 +482,9 @@ BEGIN ELSE ST_Reverse(e.geom) END + -- TODO: how to make sure rows are ordered ? ORDER BY seq ) geom, - ST_LineMerge( ST_Collect( - CASE WHEN signed_edge_id > 0 THEN - e.geom - ELSE - ST_Reverse(e.geom) - END - ) FILTER ( WHERE NOT r.dangling ) ) - non_dangling_edges_merge, array_agg( DISTINCT CASE WHEN signed_edge_id > 0 THEN @@ -509,7 +501,7 @@ BEGIN WHERE e.edge_id = abs(r.signed_edge_id) GROUP BY ring_id ) --}{ - SELECT ring_id, geom as ring_geom, non_dangling_edges_merge, side_faces, distinct_edges, num_edges + SELECT ring_id, geom as ring_geom, side_faces, distinct_edges, num_edges FROM all_rings_with_ring_geom LOOP --}{ @@ -556,28 +548,10 @@ BEGIN IF ST_NPoints(rec.ring_geom) > 3 AND rec.num_edges != rec.distinct_edges * 2 THEN - -- TODO: directly build candidate shell polygon from non-dangling portions ? ring_poly := ST_MakePolygon(rec.ring_geom); - /* - 1. Make polygon from non-dangling edge merge - 2. Pick the one with largest area - 3. Check if CCW - */ - WITH irings AS ( - SELECT ST_MakePolygon(geom) geom - FROM ST_Dump(rec.non_dangling_edges_merge) - -- TODO: report non-closed rings from non-dangling edges as another invalidity - WHERE ST_StartPoint(geom) = ST_EndPoint(geom) - ), - largest_iring AS ( - SELECT geom FROM irings - ORDER BY ST_Area(geom) DESC LIMIT 1 - ) - SELECT ST_IsPolygonCCW(geom) FROM largest_iring - INTO is_shell; -#if POSTGIS_TOPOLOGY_DEBUG > 1 - RAISE NOTICE 'Ring % is CCW ? %', rec.ring_id, is_shell; -#endif + IF ST_IsPolygonCCW(ring_poly) THEN + is_shell := true; + END IF; END IF; #ifdef POSTGIS_TOPOLOGY_DEBUG commit 83ba9c60da7d47e936848eb2a764b23e53c37598 Author: Sandro Santilli Date: Wed Apr 15 17:39:49 2026 +0200 Revert CCW computation changes in liblwgeom-topo The implementation fails for CCW rings with holes touching the ring This reverts 00440ad2900ced28817d18e4908a13bff455588a but keeps the changes that might make it easier to improve orientation later. diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 0faec58e5..4abef795c 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -1887,15 +1887,12 @@ static LWPOLY * _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num_signed_edge_ids, int *isccw, GBOX *ringbox) { LWT_ELEMID *edge_ids; - LWT_ELEMID *dangling_edge_ids; - uint64_t numedges, num_dangling, j, i; + uint64_t numedges, j, i; LWT_ISO_EDGE *ring_edges; /* Construct a polygon using edges of the ring */ numedges = 0; - num_dangling = 0; edge_ids = lwalloc(sizeof(LWT_ELEMID)*num_signed_edge_ids); - dangling_edge_ids = lwalloc(sizeof(LWT_ELEMID)*num_signed_edge_ids); for (i=0; ipoints, &edgebox) ) { - lwfree( dangling_edge_ids ); lwerror("Could not calculate bounding box of edge %" LWTFMT_ELEMID, ring_edges[i].edge_id); return NULL; } @@ -1951,7 +1944,6 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num /* Should now build a polygon with those edges, in the order * given by GetRingEdges. */ - LWCOLLECTION *non_dangling_collection = NULL; POINTARRAY *full_ring_pa = NULL; for ( i=0; igeom->points, 0); } } - - int found = 0; - for ( j=0; jedge_id ) - { - found = 1; - break; - } - } - if ( found ) - { - LWDEBUGF(2, "Edge %" LWTFMT_ELEMID " is dangling (index %" PRIu64 ")", edge->edge_id, j); - continue; - } - - if ( non_dangling_collection == NULL ) - { - non_dangling_collection = lwcollection_construct_empty( - COLLECTIONTYPE, - topo->srid, - topo->hasZ, - 0 - ); - } - POINTARRAY *pa_toadd = ptarray_clone_deep(edge->geom->points); - if ( eid < 0 ) - { - ptarray_reverse_in_place(pa_toadd); - } - lwcollection_add_lwgeom( - non_dangling_collection, - lwline_as_lwgeom(lwline_construct(topo->srid, NULL, pa_toadd)) - ); } - lwfree( dangling_edge_ids ); _lwt_release_edges(ring_edges, numedges); if ( ! ptarray_is_closed_2d(full_ring_pa) ) @@ -2041,58 +1997,6 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num return NULL; } - if ( non_dangling_collection == NULL ) /* all edges are dangling ! */ - { - lwnotice("All edges in ring are dangling, will not report as ccw"); - *isccw = 0; - } - - LWGEOM *merged = lwgeom_linemerge(lwcollection_as_lwgeom(non_dangling_collection)); - lwcollection_free(non_dangling_collection); - - LWDEBUGG(2, merged, "Linemerged non-dangling edges"); - - switch (merged->type) - { - case LINETYPE: - { - LWLINE *line = (LWLINE *)(merged); - POINTARRAY *pa = line->points; - *isccw = ptarray_isccw(pa); - break; - } - case MULTILINETYPE: - { - double maxarea = 0; - LWMLINE *mline = (LWMLINE *)(merged); - /* find the one with the largest area */ - for ( i=0; ingeoms; ++i ) - { - const LWLINE *l = mline->geoms[i]; - const POINTARRAY *pa = l->points; - double sarea; - - /* skip non-closed rings */ - //if ( ! ptarray_is_closed_2d(pa) ) continue; - - sarea = ptarray_signed_area(pa); - LWDEBUGF(3, "Signed area of ring %" PRIu64 ": %g", i, sarea); - if ( fabs(sarea) > fabs(maxarea) ) { - maxarea = sarea; - } - } - LWDEBUGF(2, "Maxarea: %g", maxarea); - *isccw = maxarea < 0 ? 1 : 0; - break; - } - default: - { - lwerror("%s: Unexpected geometry type from lwgeom_linemerge: %s", __func__, lwtype_name(merged->type)); - return NULL; - } - } - - POINTARRAY **points = lwalloc(sizeof(POINTARRAY*)); points[0] = full_ring_pa; @@ -2100,12 +2004,10 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num * which would make it topologically invalid */ LWPOLY* shell = lwpoly_construct(0, 0, 1, points); -#if POSTGIS_DEBUG_LEVEL > 0 - if ( ptarray_isccw(shell->rings[0]) != *isccw ) - { - LWDEBUGF(1, "CCW disagreement on signed edge id %" LWTFMT_ELEMID, signed_edge_ids[0]); - } -#endif + + /* TODO: skip if all edges were dangling ? */ + *isccw = ptarray_isccw(shell->rings[0]); + return shell; } commit 5e3b36d6ab3cd2c1c1191ac95257332fef0e9e1b Author: Sandro Santilli Date: Wed Apr 15 17:43:42 2026 +0200 Back to long-double This reverts commit cfb81e6a5bf761b6603a6425e689d82d5f3b046c. diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c index 5c6796e75..65b72290b 100644 --- a/liblwgeom/ptarray.c +++ b/liblwgeom/ptarray.c @@ -1083,7 +1083,7 @@ ptarray_signed_area(const POINTARRAY *pa) const POINT2D *P1; const POINT2D *P2; const POINT2D *P3; - double sum = 0.0; + long double sum = 0.0; double x0, x, y1, y2; uint32_t i; ----------------------------------------------------------------------- Summary of changes: liblwgeom/ptarray.c | 2 +- liblwgeom/topo/lwgeom_topo.c | 108 ++-------------------------- topology/sql/manage/ValidateTopology.sql.in | 38 ++-------- 3 files changed, 12 insertions(+), 136 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Wed Apr 15 08:52:34 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 15:52:34 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.48686bb74eb108689af8bb9986151a33@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+------------------------ Changes (by strk): * resolution: fixed => * status: closed => reopened Comment: Reopening as the CCW determination based on skipping dangling edges was bogus, and the "long double" (now back in effect) is still not enough to fix this case on MacOS -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 15 08:52:52 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 15:52:52 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.4bdcd93736d0c4f65f36de086dcd7599@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by strk): * resolution: fixed => * status: closed => reopened Comment: Reopening as the CCW determination based on skipping dangling edges was bogus, and the "long double" (now back in effect) is still not enough to fix this case on MacOS and winnie -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Wed Apr 15 08:53:38 2026 From: trac at osgeo.org (PostGIS) Date: Wed, 15 Apr 2026 15:53:38 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.1a2d52e24dab64624854fb913556e3fd@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Changes (by strk): * resolution: fixed => * status: closed => reopened Comment: Reopening as the CCW determination based on skipping dangling edges was bogus, and the "long double" (now back in effect as of [e21fe0083bd1fdd7477e60162b793870f8b536fc/git]) is still not enough to fix this case on MacOS -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 01:57:54 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 08:57:54 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.96a4f88a6b799dbc32777bf73c888a65@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+--------------------------- Changes (by strk): * keywords: => robustness -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 01:58:03 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 08:58:03 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.49784e35cd4f6b1e038ddff8a972bd3a@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+--------------------------- Changes (by strk): * keywords: => robustness -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 16 02:25:51 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 16 Apr 2026 02:25:51 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-462-ge1524ad91 Message-ID: <20260416092552.3464C30D80@trac.osgeo.org> 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 e1524ad9145af2dedf45391a581a8f48436817b7 (commit) from e21fe0083bd1fdd7477e60162b793870f8b536fc (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 e1524ad9145af2dedf45391a581a8f48436817b7 Author: Sandro Santilli Date: Thu Apr 16 11:25:12 2026 +0200 Fix error message on GEOSCovers exception diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index e93db0af7..3fadca8f2 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -2696,7 +2696,7 @@ Datum LWGEOM_dfullywithin(PG_FUNCTION_ARGS) GEOSGeom_destroy(buffer1); GEOSGeom_destroy(geos2); - if (contained == 2) HANDLE_GEOS_ERROR("GEOSContains"); + if (contained == 2) HANDLE_GEOS_ERROR("GEOSCovers"); PG_FREE_IF_COPY(geom1, 0); PG_FREE_IF_COPY(geom2, 1); ----------------------------------------------------------------------- Summary of changes: postgis/lwgeom_geos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 16 02:45:21 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 09:45:21 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.62d7933f09e4fe81048bef9190922b2a@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+--------------------------- Comment (by strk): Outcomes with SFCGAL orientation algorithms can be inspected here: https://gitea.osgeo.org/postgis/postgis/pulls/293 At first, the testsuite is full of failures -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 04:57:03 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 11:57:03 -0000 Subject: [PostGIS] #6072: loader scripts for os type 'sh' do not create schema tiger_data Message-ID: <052.e62fa89168934007c19e959c1918be99@osgeo.org> #6072: loader scripts for os type 'sh' do not create schema tiger_data ----------------------------+--------------------------- Reporter: epolkerman | Owner: robe Type: defect | Status: new Priority: low | Milestone: PostGIS 3.6.3 Component: tiger geocoder | Version: 3.6.x Keywords: | ----------------------------+--------------------------- As of issue #6049 the postgis_tiger_geocoder extension does not create the schema tiger_data anymore. In stead the tiger_data schema should be created by the loader scripts when executed. However for os type 'sh' (unix/linux) this is not the case: ERROR: schema "tiger_data" does not exist In the extension sql file it can be seen that the part creating the schema is only inserted in table 'loader_platform' for os 'windows': %PSQL% -c "DO language ''plpgsql'' $$ BEGIN IF NOT EXISTS (SELECT * FROM information_schema.schemata WHERE schema_name = ''${data_schema}'' ) THEN CREATE SCHEMA ${data_schema}; END IF; END $$" This is missing in the insert for table 'loader_platform' for os 'sh' -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 16 06:29:42 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 16 Apr 2026 06:29:42 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-463-g3be7588bb Message-ID: <20260416132943.38C1236BF2@trac.osgeo.org> 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 3be7588bb843480b45ea352c2fd29b7aa7ad43ff (commit) from e1524ad9145af2dedf45391a581a8f48436817b7 (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 3be7588bb843480b45ea352c2fd29b7aa7ad43ff Author: Sandro Santilli Date: Thu Apr 16 15:29:06 2026 +0200 [woodie] Fix the configure switch to disable spell checking diff --git a/.woodpecker/regress.yml b/.woodpecker/regress.yml index b68cc13c3..209af1a2a 100644 --- a/.woodpecker/regress.yml +++ b/.woodpecker/regress.yml @@ -23,7 +23,7 @@ variables: - cd "$${BUILDDIR}" - $${SRCDIR}/configure --with-library-minor-version - --without-code-spell + --disable-spellcheck-tests --enable-lto --without-interrupt-tests --disable-spellcheck-tests ----------------------------------------------------------------------- Summary of changes: .woodpecker/regress.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 16 08:26:25 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 15:26:25 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.634a032f6dd5e08e5533f2423e6d210b@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+--------------------------- Comment (by strk): MacOS seems happy with SFCGAL backed orientation test: https://github.com/postgis/postgis/actions/runs/24517797174/job/71666698668 Except newer SFGAL changes that algorithm to delegate to GDAL (https://gitlab.com/sfcgal/SFCGAL/-/commit/79147457a6532b528b858eb62bcd66cc49c3b057), effectively breaking a lot of tests (https://github.com/postgis/postgis/actions/runs/24517797133/job/71666698732) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 09:30:44 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 16:30:44 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.c9b690dd1b6e00badd4903d9aaaf18a5@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+--------------------------- Changes (by strk): * cc: lbart (added) Comment: New PR tries the SFGAL approach: https://gitea.osgeo.org/postgis/postgis/pulls/295 It seems to work fine, as long as SFGAL doesn't break it with the fix for #3651 ( https://gitlab.com/sfcgal/SFCGAL/-/commit/79147457a6532b528b858eb62bcd66cc49c3b057 ) -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 12:56:38 2026 From: trac at osgeo.org (PostGIS) Date: Thu, 16 Apr 2026 19:56:38 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.df1d16947d027ed324e8fda57ff8efbb@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: reopened Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: robustness -----------------------+--------------------------- Comment (by strk): libgmp based implementation here: https://gitea.osgeo.org/postgis/postgis/pulls/296 -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 16 21:55:17 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 16 Apr 2026 21:55:17 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-465-g31956e07c Message-ID: <20260417045517.8E73913980C@trac.osgeo.org> 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 31956e07c53f44654538092b6a229036e0430256 (commit) via 6dad9ae02fffea7adbf2ef4da102d18a1bdc0767 (commit) from 3be7588bb843480b45ea352c2fd29b7aa7ad43ff (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 ----------------------------------------------------------------- ----------------------------------------------------------------------- Summary of changes: configure.ac | 17 +++++++-- liblwgeom/ptarray.c | 2 +- liblwgeom/topo/liblwgeom_topo.h | 4 ++- liblwgeom/topo/lwgeom_topo.c | 56 +++++++++++++++++++++++++++-- topology/postgis_topology.c | 21 ++++++++++- topology/sql/manage/ValidateTopology.sql.in | 9 +++-- 6 files changed, 97 insertions(+), 12 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Thu Apr 16 21:55:20 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 04:55:20 -0000 Subject: [PostGIS] #6064: Silent topology corruption with topology.ST_AddEdgeModFace In-Reply-To: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> References: <046.ffadf8242a9861b869c6a7c645b613eb@osgeo.org> Message-ID: <061.e841e1532429c79554d24fdb4fcd3d21@osgeo.org> #6064: Silent topology corruption with topology.ST_AddEdgeModFace -----------------------+------------------------ Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: Component: topology | Version: master Resolution: fixed | Keywords: robustness -----------------------+------------------------ Changes (by Sandro Santilli ): * resolution: => fixed * status: reopened => closed Comment: In [changeset:"6dad9ae02fffea7adbf2ef4da102d18a1bdc0767/git" 6dad9ae/git]: {{{#!CommitTicketReference repository="git" revision="6dad9ae02fffea7adbf2ef4da102d18a1bdc0767" Use the GNU Multiple Precision Library for topo ring CCW detection Closes #6064, #6065, #6067 Note that libgmp is already a dependency of libproj so we're not adding a new dependency to liblwgeom. }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 21:55:20 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 04:55:20 -0000 Subject: [PostGIS] #6065: ValidateTopology fails to report invalid side-labeling In-Reply-To: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> References: <046.6311baf443421c3a06d81dcca2c5966b@osgeo.org> Message-ID: <061.9c09f361f4b7e8974b99d1ed501b3e60@osgeo.org> #6065: ValidateTopology fails to report invalid side-labeling -----------------------+--------------------------- Reporter: strk | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: fixed | Keywords: robustness -----------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: reopened => closed Comment: In [changeset:"6dad9ae02fffea7adbf2ef4da102d18a1bdc0767/git" 6dad9ae/git]: {{{#!CommitTicketReference repository="git" revision="6dad9ae02fffea7adbf2ef4da102d18a1bdc0767" Use the GNU Multiple Precision Library for topo ring CCW detection Closes #6064, #6065, #6067 Note that libgmp is already a dependency of libproj so we're not adding a new dependency to liblwgeom. }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Thu Apr 16 21:55:20 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 04:55:20 -0000 Subject: [PostGIS] #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology In-Reply-To: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> References: <046.25dd3ea0daad258dd81ccd861987b35e@osgeo.org> Message-ID: <061.4edabfbe58a0a36cb7aac4dee0af6ec9@osgeo.org> #6067: MacOS CI and winnie failing on topology topogeo_addlinestring, validatetopology -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: fixed | Keywords: robustness -----------------------+--------------------------- Changes (by Sandro Santilli ): * resolution: => fixed * status: reopened => closed Comment: In [changeset:"6dad9ae02fffea7adbf2ef4da102d18a1bdc0767/git" 6dad9ae/git]: {{{#!CommitTicketReference repository="git" revision="6dad9ae02fffea7adbf2ef4da102d18a1bdc0767" Use the GNU Multiple Precision Library for topo ring CCW detection Closes #6064, #6065, #6067 Note that libgmp is already a dependency of libproj so we're not adding a new dependency to liblwgeom. }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From git at osgeo.org Thu Apr 16 23:09:58 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 16 Apr 2026 23:09:58 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-466-g3f84b6374 Message-ID: <20260417060958.B1A3B13B5E6@trac.osgeo.org> 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 3f84b63747b1c02c8680968b2684739732bb33db (commit) from 31956e07c53f44654538092b6a229036e0430256 (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 3f84b63747b1c02c8680968b2684739732bb33db Author: Sandro Santilli Date: Fri Apr 17 08:09:47 2026 +0200 Do not spellcheck config.status diff --git a/.codespellrc b/.codespellrc index 5fea525d5..4ff3c8458 100644 --- a/.codespellrc +++ b/.codespellrc @@ -14,6 +14,7 @@ skip = ./raster/rt_pg/*.sql, aclocal.m4, configure, + config.stastus, libtool, ./macros/libtool.m4, spatial_ref_sys.sql, ----------------------------------------------------------------------- Summary of changes: .codespellrc | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- PostGIS From git at osgeo.org Thu Apr 16 23:32:10 2026 From: git at osgeo.org (git at osgeo.org) Date: Thu, 16 Apr 2026 23:32:10 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-467-g2d1da1051 Message-ID: <20260417063210.4914013BB75@trac.osgeo.org> 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 2d1da1051f12c36419003b43ec5139143ce61993 (commit) from 3f84b63747b1c02c8680968b2684739732bb33db (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 2d1da1051f12c36419003b43ec5139143ce61993 Author: Sandro Santilli Date: Fri Apr 17 08:31:39 2026 +0200 Really ignore config.status (typo in prev commit) diff --git a/.codespellrc b/.codespellrc index 4ff3c8458..b3a838dfc 100644 --- a/.codespellrc +++ b/.codespellrc @@ -14,7 +14,7 @@ skip = ./raster/rt_pg/*.sql, aclocal.m4, configure, - config.stastus, + config.status, libtool, ./macros/libtool.m4, spatial_ref_sys.sql, ----------------------------------------------------------------------- Summary of changes: .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Apr 17 00:13:18 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 17 Apr 2026 00:13:18 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-468-g123d16873 Message-ID: <20260417071318.A14D913BCD4@trac.osgeo.org> 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 123d1687331c22066c5e8c901e5a2c7cd46c0ba8 (commit) from 2d1da1051f12c36419003b43ec5139143ce61993 (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 123d1687331c22066c5e8c901e5a2c7cd46c0ba8 Author: Sandro Santilli Date: Fri Apr 17 07:49:40 2026 +0200 Use 64bit of precision in the topo CCW test It seems to be enough precision, including on MacOS and windows diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index e101c3664..584b4d210 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -1902,7 +1902,7 @@ lwt_IsTopoRingCCW(const LWGEOM *lwg) if (! pa || pa->npoints < 3 ) return 0; - mpf_init2(sum, 128); + mpf_init2(sum, 64); mpf_init2(tmp, 64); mpf_set_d(sum, 0.0); ----------------------------------------------------------------------- Summary of changes: liblwgeom/topo/lwgeom_topo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Apr 17 00:38:05 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 17 Apr 2026 00:38:05 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-469-gbb1a71e15 Message-ID: <20260417073805.91D2713CEA5@trac.osgeo.org> 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 bb1a71e15fdece2cab099682be270683b529cbc9 (commit) from 123d1687331c22066c5e8c901e5a2c7cd46c0ba8 (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 bb1a71e15fdece2cab099682be270683b529cbc9 Author: Sandro Santilli Date: Fri Apr 17 09:37:46 2026 +0200 Reduce polygon construction when all we need is CCW detection of ring diff --git a/liblwgeom/topo/liblwgeom_topo.h b/liblwgeom/topo/liblwgeom_topo.h index d3e3cd133..fb25c3a10 100644 --- a/liblwgeom/topo/liblwgeom_topo.h +++ b/liblwgeom/topo/liblwgeom_topo.h @@ -1430,6 +1430,6 @@ int lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face, LWT_ELEMID **edges); */ LWGEOM* lwt_GetFaceGeometry(LWT_TOPOLOGY* topo, LWT_ELEMID face); -int lwt_IsTopoRingCCW(const LWGEOM *geom); +int lwt_IsTopoRingCCW(const POINTARRAY *pa); #endif /* LIBLWGEOM_TOPO_H */ diff --git a/liblwgeom/topo/lwgeom_topo.c b/liblwgeom/topo/lwgeom_topo.c index 584b4d210..6d0144bb9 100644 --- a/liblwgeom/topo/lwgeom_topo.c +++ b/liblwgeom/topo/lwgeom_topo.c @@ -1881,10 +1881,8 @@ _lwt_GetInteriorEdgePoint(const LWLINE* edge, POINT2D* ip) } int -lwt_IsTopoRingCCW(const LWGEOM *lwg) +lwt_IsTopoRingCCW(const POINTARRAY *pa) { - LWPOLY *poly = lwgeom_as_lwpoly(lwg); - POINTARRAY *pa; const POINT2D *P1; const POINT2D *P2; const POINT2D *P3; @@ -1894,11 +1892,6 @@ lwt_IsTopoRingCCW(const LWGEOM *lwg) uint32_t i; int ret; - if ( ! poly ) return 0; - if ( ! poly->nrings ) return 0; - - pa = poly->rings[0]; - if (! pa || pa->npoints < 3 ) return 0; @@ -2048,6 +2041,8 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num return NULL; } + *isccw = lwt_IsTopoRingCCW(full_ring_pa); + POINTARRAY **points = lwalloc(sizeof(POINTARRAY*)); points[0] = full_ring_pa; @@ -2056,8 +2051,6 @@ _lwt_MakeRingShell(LWT_TOPOLOGY *topo, LWT_ELEMID *signed_edge_ids, uint64_t num */ LWPOLY* shell = lwpoly_construct(0, 0, 1, points); - *isccw = lwt_IsTopoRingCCW(lwpoly_as_lwgeom(shell)); - return shell; } diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c index 769cececb..0599fc010 100644 --- a/topology/postgis_topology.c +++ b/topology/postgis_topology.c @@ -5828,10 +5828,31 @@ Datum TopoRingIsCCW(PG_FUNCTION_ARGS) GSERIALIZED *geom; LWGEOM *lwgeom; int isCCW; + const POINTARRAY *pa; geom = PG_GETARG_GSERIALIZED_P(0); lwgeom = lwgeom_from_gserialized(geom); - isCCW = lwt_IsTopoRingCCW(lwgeom); + + if ( lwgeom_is_empty(lwgeom) ) + { + PG_RETURN_BOOL(false); + } + + if (lwgeom->type == POLYGONTYPE) + { + pa = ((const LWPOLY *)lwgeom)->rings[0]; + } + else if (lwgeom->type == LINETYPE) + { + pa = ((const LWLINE *)lwgeom)->points; + } + else + { + lwpgerror("Unsupported geometry type passed to TopoRingIsCCW"); + PG_RETURN_NULL(); + } + + isCCW = lwt_IsTopoRingCCW(pa); lwgeom_free(lwgeom); PG_FREE_IF_COPY(geom, 0); diff --git a/topology/sql/manage/ValidateTopology.sql.in b/topology/sql/manage/ValidateTopology.sql.in index 08ccd06f5..fb6f23c02 100644 --- a/topology/sql/manage/ValidateTopology.sql.in +++ b/topology/sql/manage/ValidateTopology.sql.in @@ -394,7 +394,6 @@ $BODY$ DECLARE retrec topology.ValidateTopology_ReturnType; rec RECORD; - ring_poly GEOMETRY; is_shell BOOLEAN; found_rings INT := 0; found_shells INT := 0; @@ -553,8 +552,7 @@ BEGIN IF ST_NPoints(rec.ring_geom) > 3 AND rec.num_edges != rec.distinct_edges * 2 THEN - ring_poly := ST_MakePolygon(rec.ring_geom); - is_shell := topology.TopoRingIsCCW(ring_poly); + is_shell := topology.TopoRingIsCCW(rec.ring_geom); END IF; #ifdef POSTGIS_TOPOLOGY_DEBUG @@ -571,7 +569,7 @@ BEGIN BEGIN INSERT INTO shell_check VALUES ( rec.side_faces[1], - ring_poly + ST_MakePolygon(rec.ring_geom) ); found_shells := found_shells + 1; EXCEPTION WHEN unique_violation THEN ----------------------------------------------------------------------- Summary of changes: liblwgeom/topo/liblwgeom_topo.h | 2 +- liblwgeom/topo/lwgeom_topo.c | 13 +++---------- topology/postgis_topology.c | 23 ++++++++++++++++++++++- topology/sql/manage/ValidateTopology.sql.in | 6 ++---- 4 files changed, 28 insertions(+), 16 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Apr 17 00:54:49 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 17 Apr 2026 00:54:49 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-470-g0feee1927 Message-ID: <20260417075449.6656B13D5D0@trac.osgeo.org> 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 0feee19278e423922717b788dd14cc9823cadc0e (commit) from bb1a71e15fdece2cab099682be270683b529cbc9 (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 0feee19278e423922717b788dd14cc9823cadc0e Author: Sandro Santilli Date: Fri Apr 17 09:54:30 2026 +0200 Put ST_Azimuth tests in its own file diff --git a/regress/core/azimuth.sql b/regress/core/azimuth.sql new file mode 100644 index 000000000..2e2977413 --- /dev/null +++ b/regress/core/azimuth.sql @@ -0,0 +1,57 @@ +--- ST_Azimuth +SELECT 'ST_Azimuth_regular' , round(ST_Azimuth(geom1,geom2)::numeric,4) +FROM CAST('POINT(0 1)' AS geometry) AS geom1, CAST('POINT(1 0)' AS geometry) AS geom2 ; +SELECT 'ST_Azimuth_same_point' , ST_Azimuth(geom1,geom1) +FROM CAST('POINT(0 1)' AS geometry) AS geom1 ; +SELECT 'ST_Azimuth_mixed_srid' , ST_Azimuth(geom1,geom2) +FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('POINT(1 0)',4326) AS geom2; +SELECT 'ST_Azimuth_not_point' , ST_Azimuth(geom1,geom2) +FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('LINESTRING(1 0 ,2 0)',4326) AS geom2; +SELECT 'ST_Azimuth_null_geom' , ST_Azimuth(geom1,geom2) +FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('EMPTY') AS geom2; + + +-- #1305 +SELECT '#1305.1',ST_AsText(ST_Project('POINT(10 10)'::geography, 0, 0)); +WITH pts AS ( SELECT 'POINT(0 45)'::geography AS s, 'POINT(45 45)'::geography AS e ) +SELECT '#1305.2',abs(ST_Distance(e, ST_Project(s, ST_Distance(s, e), ST_Azimuth(s, e)))) < 0.001 FROM pts; +SELECT '#1305.3',ST_Azimuth('POINT(0 45)'::geography, 'POINT(0 45)'::geography) IS NULL; + + +-- #1791 -- +with inp as ( SELECT + '010100000000000000004065C0041AD965BE5554C0'::geometry as a, + '010100000001000000004065C0041AD965BE5554C0'::geometry as b +) SELECT '#1791', round(ST_Azimuth(a,b)*10)/10 from inp; + +SELECT '#4718', + round(degrees( + ST_Azimuth('POINT(77.46412 37.96999)'::geography, + 'POINT(77.46409 37.96999)'::geography + ))::numeric,3), + round(degrees( + ST_Azimuth('POINT(77.46412 37.96999)'::geography, + 'POINT(77.46429 37.96999)'::geography + ))::numeric,3); + +SELECT +'#4840', +round(degrees(ST_azimuth(C,N))) AS az_n, +round(degrees(ST_azimuth(C,NE))) AS az_ne, +round(degrees(ST_azimuth(C,E))) AS az_e, +round(degrees(ST_azimuth(C,SE))) AS az_se, +round(degrees(ST_azimuth(C,S))) AS az_s, +round(degrees(ST_azimuth(C,SW))) AS az_sw, +round(degrees(ST_azimuth(C,W))) AS az_w, +round(degrees(ST_azimuth(C,NW))) AS az_nw +FROM (SELECT +'POINT(5 55)'::geography AS C, +'POINT(5 56)'::geography AS N, +'POINT(6 56)'::geography AS NE, +'POINT(6 55)'::geography AS E, +'POINT(6 54)'::geography AS SE, +'POINT(5 54)'::geography AS S, +'POINT(4 54)'::geography AS SW, +'POINT(4 55)'::geography AS W, +'POINT(4 56)'::geography AS NW ) points; + diff --git a/regress/core/azimuth_expected b/regress/core/azimuth_expected new file mode 100644 index 000000000..c24002591 --- /dev/null +++ b/regress/core/azimuth_expected @@ -0,0 +1,11 @@ +ST_Azimuth_regular|2.3562 +ST_Azimuth_same_point| +ERROR: Operation on mixed SRID geometries +ERROR: Argument must be POINT geometries +ERROR: parse error - invalid geometry +#1305.1|POINT(10 10) +#1305.2|t +#1305.3|t +#1791|4.7 +#4718|270.000|90.000 +#4840|0|29|90|149|180|211|270|331 diff --git a/regress/core/lwgeom_regress.sql b/regress/core/lwgeom_regress.sql index c31487c30..3c647e3c8 100644 --- a/regress/core/lwgeom_regress.sql +++ b/regress/core/lwgeom_regress.sql @@ -155,18 +155,6 @@ SELECT 'BoundingDiagonal7.1', ST_AsEwkt(ST_BoundingDiagonal(postgis_addbbox('SRI SELECT 'BoundingDiagonal7.2', ST_AsEwkt(ST_BoundingDiagonal('SRID=3857;MULTILINESTRING Z ((5 4 0,4 4 1))'::geometry)); SELECT 'BoundingDiagonal7.3', ST_AsEwkt(ST_BoundingDiagonal(postgis_addbbox('SRID=3857;MULTILINESTRING Z ((5 4 0,4 4 1))'::geometry))); ---- ST_Azimuth -SELECT 'ST_Azimuth_regular' , round(ST_Azimuth(geom1,geom2)::numeric,4) -FROM CAST('POINT(0 1)' AS geometry) AS geom1, CAST('POINT(1 0)' AS geometry) AS geom2 ; -SELECT 'ST_Azimuth_same_point' , ST_Azimuth(geom1,geom1) -FROM CAST('POINT(0 1)' AS geometry) AS geom1 ; -SELECT 'ST_Azimuth_mixed_srid' , ST_Azimuth(geom1,geom2) -FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('POINT(1 0)',4326) AS geom2; -SELECT 'ST_Azimuth_not_point' , ST_Azimuth(geom1,geom2) -FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('LINESTRING(1 0 ,2 0)',4326) AS geom2; -SELECT 'ST_Azimuth_null_geom' , ST_Azimuth(geom1,geom2) -FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('EMPTY') AS geom2; - --- ST_Angle(points) SELECT 'ST_Angle_4_pts', St_Angle(p1,p2,p3,p4)::numeric(12,6) FROM ST_GeomFromtext('POINT(0 1)') AS p1, ST_GeomFromtext('POINT(0 0)') AS p2 diff --git a/regress/core/lwgeom_regress_expected b/regress/core/lwgeom_regress_expected index dc3a70ecc..8239d0fec 100644 --- a/regress/core/lwgeom_regress_expected +++ b/regress/core/lwgeom_regress_expected @@ -42,11 +42,6 @@ BoundingDiagonal7 |SRID=3857;LINESTRINGM(4 4 0,5 4 1) BoundingDiagonal7.1|SRID=3857;LINESTRINGM(4 4 0,5 4 1) BoundingDiagonal7.2|SRID=3857;LINESTRING(4 4 0,5 4 1) BoundingDiagonal7.3|SRID=3857;LINESTRING(4 4 0,5 4 1) -ST_Azimuth_regular|2.3562 -ST_Azimuth_same_point| -ERROR: Operation on mixed SRID geometries -ERROR: Argument must be POINT geometries -ERROR: parse error - invalid geometry ST_Angle_4_pts|4.712389 ST_Angle_4_pts|0.785398 ST_Angle_3_pts|1.570796 diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in index fc998a755..5e334ee5e 100644 --- a/regress/core/tests.mk.in +++ b/regress/core/tests.mk.in @@ -29,6 +29,7 @@ RUNTESTFLAGS_INTERNAL += \ TESTS += \ $(top_srcdir)/regress/core/affine \ + $(top_srcdir)/regress/core/azimuth \ $(top_srcdir)/regress/core/bestsrid \ $(top_srcdir)/regress/core/binary \ $(top_srcdir)/regress/core/boundary \ diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql index 4c1fcb862..1dd8f2e98 100644 --- a/regress/core/tickets.sql +++ b/regress/core/tickets.sql @@ -489,12 +489,6 @@ SELECT '#657.1',Round(ST_X(ST_Project('POINT(175 10)'::geography, 2000000, 3.141 SELECT '#657.2',Round(ST_Distance(ST_Project('POINT(10 10)'::geography, 10, 0), 'POINT(10 10)'::geography)::numeric,2); SELECT '#657.3',ST_DWithin(ST_Project('POINT(10 10)'::geography, 2000, pi()/2), 'POINT(10 10)'::geography, 2000); --- #1305 -SELECT '#1305.1',ST_AsText(ST_Project('POINT(10 10)'::geography, 0, 0)); -WITH pts AS ( SELECT 'POINT(0 45)'::geography AS s, 'POINT(45 45)'::geography AS e ) -SELECT '#1305.2',abs(ST_Distance(e, ST_Project(s, ST_Distance(s, e), ST_Azimuth(s, e)))) < 0.001 FROM pts; -SELECT '#1305.3',ST_Azimuth('POINT(0 45)'::geography, 'POINT(0 45)'::geography) IS NULL; - -- #1445 SELECT '01060000400200000001040000400100000001010000400000000000000000000000000000000000000000000000000101000040000000000000F03F000000000000F03F000000000000F03F'::geometry; SELECT '01050000400200000001040000400100000001010000400000000000000000000000000000000000000000000000000101000040000000000000F03F000000000000F03F000000000000F03F'::geometry; @@ -679,12 +673,6 @@ FROM inp; -- #1780 -- SELECT '#1780',ST_GeoHash('POINT(4 4)'::geometry) = ST_GeoHash('POINT(4 4)'::geography); --- #1791 -- -with inp as ( SELECT - '010100000000000000004065C0041AD965BE5554C0'::geometry as a, - '010100000001000000004065C0041AD965BE5554C0'::geometry as b -) SELECT '#1791', round(ST_Azimuth(a,b)*10)/10 from inp; - -- #1799 -- SELECT '#1799', ST_Segmentize('LINESTRING(0 0, 10 0)'::geometry, 0); @@ -1343,16 +1331,6 @@ SELECT '#4689', _ST_DistanceTree('POLYGON ((30 10, 40 40, 20 40, 30 10))'::geogr 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( - ST_Azimuth('POINT(77.46412 37.96999)'::geography, - 'POINT(77.46409 37.96999)'::geography - ))::numeric,3), - round(degrees( - ST_Azimuth('POINT(77.46412 37.96999)'::geography, - 'POINT(77.46429 37.96999)'::geography - ))::numeric,3); - SELECT '#4727', _ST_DistanceTree('SRID=4326;POLYGON((-179.9 -85.05112877980659, -179.9 74.99999999999997, -152 80, -130 84.99999999999997, -115 85.05112877980659, -60 85.05112877980659, -60 79, -70 70, -130 50, -80 6, -65 -53, -100 -85.05112877980659, -179.9 -85.05112877980659))'::geography, ST_MakePoint(-150,-40), 0.0, true); @@ -1360,27 +1338,6 @@ SELECT '#4796', st_astext(st_snaptogrid(st_normalize(st_simplifypreservetopology SELECT '#4812', st_srid('SRID=999999;POINT(1 1)'::geometry); -SELECT -'#4840', -round(degrees(ST_azimuth(C,N))) AS az_n, -round(degrees(ST_azimuth(C,NE))) AS az_ne, -round(degrees(ST_azimuth(C,E))) AS az_e, -round(degrees(ST_azimuth(C,SE))) AS az_se, -round(degrees(ST_azimuth(C,S))) AS az_s, -round(degrees(ST_azimuth(C,SW))) AS az_sw, -round(degrees(ST_azimuth(C,W))) AS az_w, -round(degrees(ST_azimuth(C,NW))) AS az_nw -FROM (SELECT -'POINT(5 55)'::geography AS C, -'POINT(5 56)'::geography AS N, -'POINT(6 56)'::geography AS NE, -'POINT(6 55)'::geography AS E, -'POINT(6 54)'::geography AS SE, -'POINT(5 54)'::geography AS S, -'POINT(4 54)'::geography AS SW, -'POINT(4 55)'::geography AS W, -'POINT(4 56)'::geography AS NW ) points; - SELECT '#4853', ST_ClusterDBSCAN(geom, eps := 0.000906495804256269, minpoints := 4) OVER() AS cid FROM (VALUES ('0101000020E6100000E4141DC9E5934B40D235936FB6193940'::geometry), ('0101000020E6100000C746205ED7934B40191C25AFCE193940'::geometry), ('0101000020E6100000C780ECF5EE934B40B6BE4868CB193940'::geometry), ('0101000020E6100000ABB2EF8AE0934B404451A04FE4193940'::geometry)) AS t(geom); SELECT '#4844', ST_AsEWKT(ST_SnapToGrid(ST_Transform('SRID=3575;POINT(370182.35945313 -2213980.8213281)'::geometry,4326),0.001)); diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected index b8b5e345c..c6185f24e 100644 --- a/regress/core/tickets_expected +++ b/regress/core/tickets_expected @@ -167,9 +167,6 @@ NOTICE: Coordinate values were coerced into range [-180 -90, 180 90] for GEOGRA #657.1|-166.78 #657.2|10.00 #657.3|t -#1305.1|POINT(10 10) -#1305.2|t -#1305.3|t ERROR: MultiPolygon cannot contain MultiPoint element at character 8 ERROR: MultiLineString cannot contain MultiPoint element at character 8 ERROR: MultiPoint cannot contain MultiPoint element at character 8 @@ -218,7 +215,6 @@ NOTICE: SRID value -1 converted to the officially unknown SRID value 0 #1755|01e9030000000000000040554000000000008041400000000000000000 #1776|POLYGON((0 0,10 0,10 10,0 0))|POLYGON((0 0,10 0,10 10,0 0)) #1780|t -#1791|4.7 ERROR: ST_Segmentize: invalid max_distance 0 (must be >= 0) ERROR: invalid GML representation #1957|1 @@ -439,11 +435,9 @@ 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)) #4812|999999 -#4840|0|29|90|149|180|211|270|331 #4853|0 #4853|0 #4853|0 ----------------------------------------------------------------------- Summary of changes: regress/core/azimuth.sql | 57 ++++++++++++++++++++++++++++++++++++ regress/core/azimuth_expected | 11 +++++++ regress/core/lwgeom_regress.sql | 12 -------- regress/core/lwgeom_regress_expected | 5 ---- regress/core/tests.mk.in | 1 + regress/core/tickets.sql | 43 --------------------------- regress/core/tickets_expected | 6 ---- 7 files changed, 69 insertions(+), 66 deletions(-) create mode 100644 regress/core/azimuth.sql create mode 100644 regress/core/azimuth_expected hooks/post-receive -- PostGIS From git at osgeo.org Fri Apr 17 01:27:23 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 17 Apr 2026 01:27:23 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-471-gb477e8b48 Message-ID: <20260417082723.6959D13E08C@trac.osgeo.org> 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 b477e8b48705a011f7c029753899168822560c48 (commit) from 0feee19278e423922717b788dd14cc9823cadc0e (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 b477e8b48705a011f7c029753899168822560c48 Author: Sandro Santilli Date: Fri Apr 17 10:25:50 2026 +0200 Add ST_Azimuth tests for NSEW directions Trying to debug https://www.ict.inaf.it/gitlab/postgis/postgis/-/jobs/149320#L5772 diff --git a/regress/core/azimuth.sql b/regress/core/azimuth.sql index 2e2977413..affdaa122 100644 --- a/regress/core/azimuth.sql +++ b/regress/core/azimuth.sql @@ -10,6 +10,11 @@ FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('LINESTRING(1 0 ,2 SELECT 'ST_Azimuth_null_geom' , ST_Azimuth(geom1,geom2) FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('EMPTY') AS geom2; +SELECT 'north', ST_Azimuth('POINT(0 0)'::geometry, 'POINT(0 10)'::geometry); -- intentionally not rounded +SELECT 'south', round(ST_Azimuth('POINT(0 0)'::geometry, 'POINT(0 -10)'::geometry)::numeric, 2); +SELECT 'east', round(ST_Azimuth('POINT(0 0)'::geometry, 'POINT(10 0)'::geometry)::numeric, 2); +SELECT 'west', round(ST_Azimuth('POINT(0 0)'::geometry, 'POINT(-10 0)'::geometry)::numeric, 2);; + -- #1305 SELECT '#1305.1',ST_AsText(ST_Project('POINT(10 10)'::geography, 0, 0)); diff --git a/regress/core/azimuth_expected b/regress/core/azimuth_expected index c24002591..217c5ca5a 100644 --- a/regress/core/azimuth_expected +++ b/regress/core/azimuth_expected @@ -3,6 +3,10 @@ ST_Azimuth_same_point| ERROR: Operation on mixed SRID geometries ERROR: Argument must be POINT geometries ERROR: parse error - invalid geometry +north|0 +south|3.14 +east|1.57 +west|4.71 #1305.1|POINT(10 10) #1305.2|t #1305.3|t ----------------------------------------------------------------------- Summary of changes: regress/core/azimuth.sql | 5 +++++ regress/core/azimuth_expected | 4 ++++ 2 files changed, 9 insertions(+) hooks/post-receive -- PostGIS From git at osgeo.org Fri Apr 17 01:33:03 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 17 Apr 2026 01:33:03 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-472-g92fd4dd04 Message-ID: <20260417083304.01B2813DE64@trac.osgeo.org> 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 92fd4dd04a8e923ea36ad7cbce44f6cf063f7299 (commit) from b477e8b48705a011f7c029753899168822560c48 (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 92fd4dd04a8e923ea36ad7cbce44f6cf063f7299 Author: Sandro Santilli Date: Fri Apr 17 10:32:37 2026 +0200 Make azimuth test more useful in case of failure Shows obtained numbers now. diff --git a/regress/core/azimuth.sql b/regress/core/azimuth.sql index affdaa122..6405e1967 100644 --- a/regress/core/azimuth.sql +++ b/regress/core/azimuth.sql @@ -10,10 +10,16 @@ FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('LINESTRING(1 0 ,2 SELECT 'ST_Azimuth_null_geom' , ST_Azimuth(geom1,geom2) FROM CAST('POINT(0 1)' AS geometry) AS geom1, ST_GeomFromText('EMPTY') AS geom2; -SELECT 'north', ST_Azimuth('POINT(0 0)'::geometry, 'POINT(0 10)'::geometry); -- intentionally not rounded -SELECT 'south', round(ST_Azimuth('POINT(0 0)'::geometry, 'POINT(0 -10)'::geometry)::numeric, 2); -SELECT 'east', round(ST_Azimuth('POINT(0 0)'::geometry, 'POINT(10 0)'::geometry)::numeric, 2); -SELECT 'west', round(ST_Azimuth('POINT(0 0)'::geometry, 'POINT(-10 0)'::geometry)::numeric, 2);; +with inp(l,g) as ( VALUES + ('north', 'LINESTRING(0 0, 0 10)'::geometry ), + ('east', 'LINESTRING(0 0, 10 0)'::geometry ), + ('south', 'LINESTRING(0 0, 0 -10)'::geometry ), + ('west', 'LINESTRING(0 0, -10 0)'::geometry ) +), azim as ( + SELECT l, g, ST_Azimuth(ST_PointN(g,1), ST_PointN(g,2)) az FROM inp +) +SELECT 'ordering', l, CASE WHEN az = 0 THEN az ELSE round(az::numeric, 2) END +FROM azim ORDER BY az; -- #1305 diff --git a/regress/core/azimuth_expected b/regress/core/azimuth_expected index 217c5ca5a..6536ef3eb 100644 --- a/regress/core/azimuth_expected +++ b/regress/core/azimuth_expected @@ -3,10 +3,10 @@ ST_Azimuth_same_point| ERROR: Operation on mixed SRID geometries ERROR: Argument must be POINT geometries ERROR: parse error - invalid geometry -north|0 -south|3.14 -east|1.57 -west|4.71 +ordering|north|0 +ordering|east|1.57 +ordering|south|3.14 +ordering|west|4.71 #1305.1|POINT(10 10) #1305.2|t #1305.3|t ----------------------------------------------------------------------- Summary of changes: regress/core/azimuth.sql | 14 ++++++++++---- regress/core/azimuth_expected | 8 ++++---- 2 files changed, 14 insertions(+), 8 deletions(-) hooks/post-receive -- PostGIS From git at osgeo.org Fri Apr 17 02:00:41 2026 From: git at osgeo.org (git at osgeo.org) Date: Fri, 17 Apr 2026 02:00:41 -0700 (PDT) Subject: [SCM] PostGIS branch master updated. 3.6.0rc2-473-g260127869 Message-ID: <20260417090042.2C74E13EA13@trac.osgeo.org> 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 26012786958aedb55589c0696086f7c48fc9fc46 (commit) from 92fd4dd04a8e923ea36ad7cbce44f6cf063f7299 (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 26012786958aedb55589c0696086f7c48fc9fc46 Author: Sandro Santilli Date: Fri Apr 17 10:59:28 2026 +0200 Robustly return 0 as azimuth for north-bound segment Or we can get 2PI instead of 0 on some platforms, see: https://www.ict.inaf.it/gitlab/postgis/postgis/-/jobs/149333#L5560 diff --git a/liblwgeom/measures.c b/liblwgeom/measures.c index e10d60bf9..1dcdd6bd2 100644 --- a/liblwgeom/measures.c +++ b/liblwgeom/measures.c @@ -2461,9 +2461,19 @@ distance2d_sqr_pt_seg(const POINT2D *C, const POINT2D *A, const POINT2D *B) int azimuth_pt_pt(const POINT2D *A, const POINT2D *B, double *d) { - if (A->x == B->x && A->y == B->y) - return LW_FALSE; + if (A->x == B->x ) + { + if ( A->y == B->y) + { + return LW_FALSE; + } + *d = A->y < B->y ? 0.0 : M_PI; + return LW_TRUE; + } + /* TODO: use M_PI_2 instead of M_PI/2 ? */ *d = fmod(2 * M_PI + M_PI / 2 - atan2(B->y - A->y, B->x - A->x), 2 * M_PI); + + /* TODO: convert 2*M_PI to 0 ? */ return LW_TRUE; } ----------------------------------------------------------------------- Summary of changes: liblwgeom/measures.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) hooks/post-receive -- PostGIS From trac at osgeo.org Fri Apr 17 02:01:44 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 09:01:44 -0000 Subject: [PostGIS] #5967: berrie 32-bit seems to crash often on topology addnode In-Reply-To: <046.a81459a88d4826e5d251096f33bd036e@osgeo.org> References: <046.a81459a88d4826e5d251096f33bd036e@osgeo.org> Message-ID: <061.b57f7578914138ea88ff6d395011af3f@osgeo.org> #5967: berrie 32-bit seems to crash often on topology addnode -----------------------+--------------------------- Reporter: robe | Owner: strk Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: topology | Version: master Resolution: | Keywords: -----------------------+--------------------------- Comment (by strk): Is this still happening after [14152529d3f3008be89dbc76505521e819ae78d5/git] ? -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 17 02:37:05 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 09:37:05 -0000 Subject: [PostGIS] #6073: Geography LRS tests failing on 32bit Message-ID: <046.e050c239c91a1bf4d681ad0d16d3e98a@osgeo.org> #6073: Geography LRS tests failing on 32bit ---------------------+--------------------------- Reporter: strk | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Keywords: | ---------------------+--------------------------- See https://www.ict.inaf.it/gitlab/postgis/postgis/-/jobs/149342#L5574 {{{ regress/core/geography .. failed (diff expected obtained: /tmp/pgis_reg/test_25_diff) ----------------------------------------------------------------------------- --- ./regress/core/geography_expected 2025-10-01 20:40:22.037797174 +0000 +++ /tmp/pgis_reg/test_25_out 2026-04-17 09:10:28.583844321 +0000 @@ -59,8 +59,8 @@ lrs_lip_1|POINT(4.35 50.85) lrs_lip_2|POINT(4.35 50.85) lrs_lip_3|POINT(37.62 55.76) -lrs_lip_4|MULTIPOINT((7.27 51.73),(10.3 52.54),(13.43 53.27),(16.67 53.91),(20 54.47),(23.42 54.93),(26.9 55.29),(30.44 55.55),(34.02 55.7),(37.62 55.76)) -lrs_lip_5|MULTIPOINT((7.27 51.73),(10.29 52.54),(13.43 53.27),(16.67 53.91),(20 54.46),(23.42 54.92),(26.9 55.29),(30.44 55.55),(34.02 55.7),(37.62 55.76)) +lrs_lip_4|MULTIPOINT((7.27 51.73),(10.3 52.54),(13.43 53.27),(16.67 53.91),(20 54.47),(23.42 54.93),(26.9 55.29),(30.44 55.55),(34.02 55.7)) +lrs_lip_5|MULTIPOINT((7.27 51.73),(10.29 52.54),(13.43 53.27),(16.67 53.91),(20 54.46),(23.42 54.92),(26.9 55.29),(30.44 55.55),(34.02 55.7)) lrs_llp_1|0.50 lrs_llp_2|0.00 lrs_llp_3|1.00 }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 17 02:38:14 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 09:38:14 -0000 Subject: [PostGIS] #6074: Geography centroid tests fail on 32bit Message-ID: <046.4f0505cfc98781f4f985e5733b552ee9@osgeo.org> #6074: Geography centroid tests fail on 32bit ---------------------+--------------------------- Reporter: strk | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Keywords: 32bit | ---------------------+--------------------------- See https://www.ict.inaf.it/gitlab/postgis/postgis/-/jobs/149342#L5590 {{{ regress/core/geography_centroid .. failed (diff expected obtained: /tmp/pgis_reg/test_26_diff) ----------------------------------------------------------------------------- --- ./regress/core/geography_centroid_expected 2025-10-01 20:40:22.037797174 +0000 +++ /tmp/pgis_reg/test_26_out 2026-04-17 09:10:28.783845075 +0000 @@ -1,5 +1,5 @@ -geog_centroid_mpt_pole_north|POINT(0 90) -geog_centroid_mpt_pole_south|POINT(0 -90) +geog_centroid_mpt_pole_north|POINT(180 90) +geog_centroid_mpt_pole_south|POINT(180 -90) geog_centroid_mpt_idl_1|180.000000|0.000000 geog_centroid_mpt_idl_2|179.500000|0.000000 geog_centroid_mpt_idl_3|-179.500000|0.000000 ----------------------------------------------------------------------------- }}} With #6073 these are the only failing tests as of [26012786958aedb55589c0696086f7c48fc9fc46/git] -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 17 02:38:30 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 09:38:30 -0000 Subject: [PostGIS] #6073: Geography LRS tests failing on 32bit In-Reply-To: <046.e050c239c91a1bf4d681ad0d16d3e98a@osgeo.org> References: <046.e050c239c91a1bf4d681ad0d16d3e98a@osgeo.org> Message-ID: <061.66ff680566d3c1d0bd0fd280ed459fe5@osgeo.org> #6073: Geography LRS tests failing on 32bit ----------------------+--------------------------- Reporter: strk | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: | Keywords: 32bit ----------------------+--------------------------- Changes (by strk): * keywords: => 32bit -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Fri Apr 17 14:34:35 2026 From: trac at osgeo.org (PostGIS) Date: Fri, 17 Apr 2026 21:34:35 -0000 Subject: [PostGIS] #6074: Geography centroid tests fail on 32bit In-Reply-To: <046.4f0505cfc98781f4f985e5733b552ee9@osgeo.org> References: <046.4f0505cfc98781f4f985e5733b552ee9@osgeo.org> Message-ID: <061.67c5b1f14024ac34df6ffc8cfc23c18f@osgeo.org> #6074: Geography centroid tests fail on 32bit ----------------------+--------------------------- Reporter: strk | Owner: pramsey Type: defect | Status: new Priority: medium | Milestone: PostGIS 3.7.0 Component: postgis | Version: master Resolution: | Keywords: 32bit ----------------------+--------------------------- Comment (by pramsey): Lacking access to 32-bit I am kind of at an impasse on these. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Mon Apr 20 01:18:04 2026 From: trac at osgeo.org (PostGIS) Date: Mon, 20 Apr 2026 08:18:04 -0000 Subject: [PostGIS] #6075: Extend ST_GetFaceGeometry with a optional srid parameter for geom Message-ID: <050.576af3d8862a6003859386a81241cf59@osgeo.org> #6075: Extend ST_GetFaceGeometry with a optional srid parameter for geom -------------------------------+--------------------------- Reporter: Lars Aksel Opsahl | Owner: strk Type: enhancement | Status: new Priority: medium | Milestone: PostGIS 3.6.3 Component: topology | Version: 3.6.x Keywords: | -------------------------------+--------------------------- When using ST_Transform on simple feature surface objects, we may end up with tiny gaps and overlaps. This is especially visible in cases with a low point density, such as the one described here: https://trac.osgeo.org/postgis/ticket/6071 One possible solution would be to add an optional parameter to https://postgis.net/docs/ST_GetFaceGeometry.html that specifies the SRID of the output geometry. With this approach, each individual edge could be transformed before assembling the surface geometry, rather than transforming the final surface as a whole. This should reduce the risk of introducing small gaps or overlaps caused by projection distortions. -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 21 03:01:49 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 21 Apr 2026 10:01:49 -0000 Subject: [PostGIS] #6061: segmentation fault when loading geometries In-Reply-To: <055.668df5469379b563df5e0230250b6b98@osgeo.org> References: <055.668df5469379b563df5e0230250b6b98@osgeo.org> Message-ID: <070.2fe6ccf2c87329e0b1df7645e8ceff97@osgeo.org> #6061: segmentation fault when loading geometries ----------------------------+--------------------------- Reporter: maxsynytsky1v | Owner: pramsey Type: defect | Status: closed Priority: medium | Milestone: PostGIS 3.6.2 Component: postgis | Version: 3.6.x Resolution: fixed | Keywords: ----------------------------+--------------------------- Comment (by maxsynytsky1v): Hello. I have just tested the fix in Debian with the freshly updated PostGIS 3.6.3 and I can confirm that the fix works and produces invalid geometry error instead of crashing the cluster: {{{ psql:gf_active_play_area.sql:1603: ERROR: parse error - invalid geometry HINT: "...890700),( 20.06211617 45.34060626, 20" <-- parse error at position 1047547 within geometry CONTEXT: COPY gf_active_play_area, line 596, column shape: "MULTIPOLYGON ((( 15.46475600 46.64170500, 15.46562100 46.64115900, 15.46663100 46.64050400, 15.4676..." }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project. From trac at osgeo.org Tue Apr 28 09:02:51 2026 From: trac at osgeo.org (PostGIS) Date: Tue, 28 Apr 2026 16:02:51 -0000 Subject: [PostGIS] #6009: Error of ST_Polygon(raster) function in PostGIS 3.4.3 and 3.5.4 In-Reply-To: <053.5b0683b43da79bf5e5b9011a9047b449@osgeo.org> References: <053.5b0683b43da79bf5e5b9011a9047b449@osgeo.org> Message-ID: <068.b86af0829b793a2659133ae022735af1@osgeo.org> #6009: Error of ST_Polygon(raster) function in PostGIS 3.4.3 and 3.5.4 -------------------------+------------------------------------------------- Reporter: | Owner: robe GISuser5432 | Type: defect | Status: closed Priority: high | Milestone: PostGIS 3.5.5 Component: raster | Version: 3.5.x Resolution: worksforme | Keywords: PostGIS_Raster; Raster; | ST_Polygon(Raster) -------------------------+------------------------------------------------- Comment (by GISuser5432): Sorry for the late return. this is the result of the full version of PostGIS: {{{ POSTGIS="3.6.0 4c1967d" [EXTENSION] PGSQL="180" GEOS="3.13.1-CAPI-1.19.2" PROJ="9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/var/lib/postgresql/.local/share/proj DATABASE_PATH=/usr/share/proj/proj.db" (compiled against PROJ 9.6.0) GDAL="GDAL 3.10.3, released 2025/04/01" LIBXML="2.9.14" LIBJSON="0.18" LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)" RASTER }}} -- Ticket URL: PostGIS The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.