[SCM] PostGIS branch master updated. 3.6.0rc2-295-gda86ae2c0
git at osgeo.org
git at osgeo.org
Tue Jan 20 13:50:19 PST 2026
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via da86ae2c0914287fe2914e28aea5360dc8af0131 (commit)
via 6ba2fd5a2f84409fd7ee069411113db562b6ddd2 (commit)
from 35d31a02d394a2ba5394b1116f78676a286e8d17 (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 da86ae2c0914287fe2914e28aea5360dc8af0131
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date: Thu Jun 5 10:30:15 2025 +0200
fix(TriangulatedSurface): TIN can be closed as PolyhedralSurface
diff --git a/liblwgeom/lwgeom.c b/liblwgeom/lwgeom.c
index c6562b5fa..b1a557feb 100644
--- a/liblwgeom/lwgeom.c
+++ b/liblwgeom/lwgeom.c
@@ -1451,8 +1451,13 @@ int lwgeom_dimension(const LWGEOM *geom)
case CURVEPOLYTYPE:
case MULTISURFACETYPE:
case MULTIPOLYGONTYPE:
- case TINTYPE:
return 2;
+ case TINTYPE:
+ {
+ /* A closed tin surface contains a volume. */
+ int closed = lwtin_is_closed((LWTIN*)geom);
+ return ( closed ? 3 : 2 );
+ }
case POLYHEDRALSURFACETYPE:
{
/* A closed polyhedral surface contains a volume. */
commit 6ba2fd5a2f84409fd7ee069411113db562b6ddd2
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date: Thu Jun 5 10:29:41 2025 +0200
test(TriangulatedSurface): Add tests
diff --git a/regress/core/tests.mk.in b/regress/core/tests.mk.in
index a959ad92f..a89b77bfc 100644
--- a/regress/core/tests.mk.in
+++ b/regress/core/tests.mk.in
@@ -119,6 +119,7 @@ TESTS += \
$(top_srcdir)/regress/core/temporal \
$(top_srcdir)/regress/core/temporal_knn \
$(top_srcdir)/regress/core/tickets \
+ $(top_srcdir)/regress/core/triangulatedsurface \
$(top_srcdir)/regress/core/twkb \
$(top_srcdir)/regress/core/typmod \
$(top_srcdir)/regress/core/wkb \
diff --git a/regress/core/triangulatedsurface.sql b/regress/core/triangulatedsurface.sql
new file mode 100644
index 000000000..cf0892e49
--- /dev/null
+++ b/regress/core/triangulatedsurface.sql
@@ -0,0 +1,40 @@
+-- ST_Dimension on 2D: not closed
+SELECT 'dimension_01', ST_Dimension('TIN(((0 0,1 1,0 1,0 0)))'::geometry);
+SELECT 'dimension_02', ST_Dimension('GEOMETRYCOLLECTION(TIN(((0 0,1 1,0 1,0 0))))'::geometry);
+
+-- ST_Dimension on 3D: closed
+SELECT 'dimension_03', ST_Dimension('TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))'::geometry);
+SELECT 'dimension_04', ST_Dimension('GEOMETRYCOLLECTION(TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0))))'::geometry);
+
+-- ST_Dimension on 4D: closed
+SELECT 'dimension_05', ST_Dimension('TIN(((0 0 0 0,0 0 1 0,0 1 0 2,0 0 0 0)),((0 0 0 0,0 1 0 0,1 0 0 4,0 0 0 0)),((0 0 0 0,1 0 0 0,0 0 1 6,0 0 0 0)),((1 0 0 0,0 1 0 0,0 0 1 0,1 0 0 0)))'::geometry);
+SELECT 'dimension_06', ST_Dimension('GEOMETRYCOLLECTION(TIN(((0 0 0 0,0 0 1 0,0 1 0 2,0 0 0 0)),((0 0 0 0,0 1 0 0,1 0 0 4,0 0 0 0)),((0 0 0 0,1 0 0 0,0 0 1 6,0 0 0 0)),((1 0 0 0,0 1 0 0,0 0 1 0,1 0 0 0))))'::geometry);
+
+-- ST_Dimension on 3D: invalid polyedron (a single edge is shared 3 times)
+SELECT 'dimension_07', ST_Dimension('TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,0 1 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))'::geometry);
+
+-- ST_Dimension on 3D: invalid polyedron (redundant point inside each face)
+SELECT 'dimension_08', ST_Dimension('TIN(((0 0 0,1 0 0,1 0 0,0 0 0)),((0 0 1,1 0 1,1 0 1,0 0 1)),((0 0 2,1 0 2,1 0 2,0 0 2)),((0 0 3,1 0 3,1 0 3,0 0 3)))'::geometry);
+
+-- ST_NumPatches
+SELECT 'numpatches_01', ST_NumPatches('TIN EMPTY'::geometry);
+SELECT 'numpatches_02', ST_NumPatches('TIN(((0 0,0 0,0 1,0 0)))'::geometry);
+SELECT 'numpatches_03', ST_NumPatches('TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))'::geometry);
+
+-- ST_PatchN
+SELECT 'patchN_01', ST_AsEWKT(ST_patchN('TIN EMPTY'::geometry, 1));
+SELECT 'patchN_02', ST_AsEWKT(ST_patchN('TIN(((0 0,0 0,0 1,0 0)))'::geometry, 1));
+SELECT 'patchN_03', ST_AsEWKT(ST_patchN('TIN(((0 0,0 0,0 1,0 0)))'::geometry, 0));
+SELECT 'patchN_04', ST_AsEWKT(ST_patchN('TIN(((0 0,0 0,0 1,0 0)))'::geometry, 2));
+SELECT 'patchN_05', ST_AsEWKT(ST_patchN('TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))'::geometry, 2));
+
+-- ST_NumGeometries
+SELECT 'numgeometries_01', ST_NumGeometries('TIN EMPTY'::geometry);
+SELECT 'numgeometries_02', ST_NumGeometries('TIN(((0 0,0 0,0 1,0 0)))'::geometry);
+SELECT 'numgeometries_03', ST_NumGeometries('TIN(((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,0 0 1,0 0 0)),((1 0 0,0 1 0,0 0 1,1 0 0)))'::geometry);
+
+-- ST_GeometryN
+SELECT 'geometryN_01', ST_AsEWKT(ST_GeometryN('TIN EMPTY'::geometry, 1));
+SELECT 'geometryN_02', ST_AsEWKT(ST_GeometryN('TIN(((0 0,0 0,0 1,0 0)))'::geometry, 1));
+SELECT 'geometryN_03', ST_AsEWKT(ST_GeometryN('TIN(((0 0,0 0,0 1,0 0)))'::geometry, 0));
+SELECT 'geometryN_04', ST_AsEWKT(ST_GeometryN('TIN(((0 0,0 0,0 1,0 0)))'::geometry, 2));
diff --git a/regress/core/triangulatedsurface_expected b/regress/core/triangulatedsurface_expected
new file mode 100644
index 000000000..ab5d737f8
--- /dev/null
+++ b/regress/core/triangulatedsurface_expected
@@ -0,0 +1,23 @@
+dimension_01|2
+dimension_02|2
+dimension_03|3
+dimension_04|3
+dimension_05|3
+dimension_06|3
+dimension_07|2
+dimension_08|2
+numpatches_01|0
+numpatches_02|1
+numpatches_03|4
+patchN_01|
+patchN_02|TRIANGLE((0 0,0 0,0 1,0 0))
+patchN_03|
+patchN_04|
+patchN_05|TRIANGLE((0 0 0,0 1 0,1 0 0,0 0 0))
+numgeometries_01|0
+numgeometries_02|1
+numgeometries_03|1
+geometryN_01|
+geometryN_02|TIN(((0 0,0 0,0 1,0 0)))
+geometryN_03|
+geometryN_04|
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/lwgeom.c | 7 +++-
regress/core/tests.mk.in | 1 +
regress/core/triangulatedsurface.sql | 40 ++++++++++++++++++++++
...rface_expected => triangulatedsurface_expected} | 6 ++--
4 files changed, 50 insertions(+), 4 deletions(-)
create mode 100644 regress/core/triangulatedsurface.sql
copy regress/core/{polyhedralsurface_expected => triangulatedsurface_expected} (69%)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list