[SCM] PostGIS branch master updated. 3.5.0-359-g8e8f09f73

git at osgeo.org git at osgeo.org
Mon Jun 2 22:11:14 PDT 2025


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  8e8f09f73cc86b3c3132aa18845ff68dbc5fa75d (commit)
       via  997d9e89485e21635de7ea4d28c472e57e558573 (commit)
      from  1ffe544650b6b69d1d3bf78cb341c6cd20aaa2f1 (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 8e8f09f73cc86b3c3132aa18845ff68dbc5fa75d
Author: Loïc Bartoletti <loic.bartoletti at oslandia.com>
Date:   Tue Jun 3 06:29:21 2025 +0200

    fix(SFCGAL): fix Extrude building and roof test

diff --git a/sfcgal/regress/extrudestraigthskeleton.sql b/sfcgal/regress/extrudestraigthskeleton.sql
index 4591993e9..434654a04 100644
--- a/sfcgal/regress/extrudestraigthskeleton.sql
+++ b/sfcgal/regress/extrudestraigthskeleton.sql
@@ -1,20 +1,41 @@
 SELECT 'Extrude roof', ST_AsText(CG_ExtrudeStraightSkeleton('POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0 0 ), (1 1, 1 2,2 2, 2 1, 1 1))', 2.0));
-WITH version_info AS (
--- The result depends on the SFCGAL Version.
--- Prior to version 2.2, it contained extra patches.
-    SELECT regexp_replace(postgis_full_version(), '.*SFCGAL="([^"]+)".*', '\1') AS sfcgal_version
-),
-skeleton AS (
-    SELECT ST_NumPatches(CG_ExtrudeStraightSkeleton('POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0 0 ), (1 1, 1 2,2 2, 2 1, 1 1))', 3.0, 2.0)) AS num_patches
-),
-check_patches AS (
-  SELECT
-      sfcgal_version,
+WITH
+  version_info AS (
+    -- The result depends on the SFCGAL Version.
+    -- Prior to version 2.2, it contained extra patches.
+    SELECT
+      string_to_array(postgis_sfcgal_version (), '.')::INT[] AS sfcgal_version_array
+  ),
+  skeleton AS (
+    SELECT
+      ST_NumPatches (
+        CG_ExtrudeStraightSkeleton (
+          'POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0 0 ), (1 1, 1 2,2 2, 2 1, 1 1))',
+          3.0,
+          2.0
+        )
+      ) AS num_patches
+  ),
+  check_patches AS (
+    SELECT
+      sfcgal_version_array,
       num_patches,
       (
-          (sfcgal_version <= '2.1.0' AND num_patches = 49) OR
-	  (sfcgal_version > '2.1.0' AND num_patches = 39)
+        (
+          sfcgal_version_array <= ARRAY[2, 1, 0]
+          AND num_patches = 49
+        )
+        OR (
+          sfcgal_version_array > ARRAY[2, 1, 0]
+          AND num_patches = 39
+        )
       ) AS test_result
-  FROM skeleton, version_info
-)
-SELECT 'Extrude building and roof', num_patches FROM skeleton;
+    FROM
+      skeleton,
+      version_info
+  )
+SELECT
+  'Extrude building and roof',
+  test_result
+FROM
+  check_patches;

commit 997d9e89485e21635de7ea4d28c472e57e558573
Author: Jean Felder <jean.felder at oslandia.com>
Date:   Mon May 26 17:50:31 2025 +0200

    sfcgal: Adapt CG_ExtrudeStraightSkeleton test to validity fix
    
    The geometry returned was invalid because the bottom/base of the roof
    was present. So, the geometry contained inner surface inside the
    building (wall + roof).
    
    The unit test is updated by counting the number of patches instead of
    checking the result. This makes it easy to have a unit test which
    works for all SFCGAL versions.
    
    See: https://gitlab.com/sfcgal/SFCGAL/-/merge_requests/511

diff --git a/doc/reference_sfcgal.xml b/doc/reference_sfcgal.xml
index 8c9226fda..168a6c644 100644
--- a/doc/reference_sfcgal.xml
+++ b/doc/reference_sfcgal.xml
@@ -2111,7 +2111,7 @@ ST_GeomFromText('POLYHEDRALSURFACE Z( ((0 0 0, 0 0 1, 0 1 1, 0 1 0, 0 0 0)),
             <title>Examples</title>
             <para>
                 <programlisting>SELECT ST_AsText(CG_ExtrudeStraightSkeleton('POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0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.5)),((1 3 3,1 2 2,2 2 2,1 3 3)),((2 2 2,2 1 2,2.5 0.5 2.5,2 2 2)),((3.5 2.5 3.5,3 3 3,3.5 1.5 3.5,3.5 2.5 3.5)),((3.5 1.5 3.5,2 2 2,2.5 0.5 2.5,3.5 1.5 3.5)),((3 3 3,2 2 2,3.5 1.5 3.5,3 3 3)))</screen>
             </para>
         </refsection>
         <refsection>
diff --git a/sfcgal/regress/extrudestraigthskeleton.sql b/sfcgal/regress/extrudestraigthskeleton.sql
index c0b8df3c1..4591993e9 100644
--- a/sfcgal/regress/extrudestraigthskeleton.sql
+++ b/sfcgal/regress/extrudestraigthskeleton.sql
@@ -1,2 +1,20 @@
 SELECT 'Extrude roof', ST_AsText(CG_ExtrudeStraightSkeleton('POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0 0 ), (1 1, 1 2,2 2, 2 1, 1 1))', 2.0));
-SELECT 'Extrude building and roof', ST_AsText(CG_ExtrudeStraightSkeleton('POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0 0 ), (1 1, 1 2,2 2, 2 1, 1 1))', 3.0, 2.0));
+WITH version_info AS (
+-- The result depends on the SFCGAL Version.
+-- Prior to version 2.2, it contained extra patches.
+    SELECT regexp_replace(postgis_full_version(), '.*SFCGAL="([^"]+)".*', '\1') AS sfcgal_version
+),
+skeleton AS (
+    SELECT ST_NumPatches(CG_ExtrudeStraightSkeleton('POLYGON (( 0 0, 5 0, 5 5, 4 5, 4 4, 0 4, 0 0 ), (1 1, 1 2,2 2, 2 1, 1 1))', 3.0, 2.0)) AS num_patches
+),
+check_patches AS (
+  SELECT
+      sfcgal_version,
+      num_patches,
+      (
+          (sfcgal_version <= '2.1.0' AND num_patches = 49) OR
+	  (sfcgal_version > '2.1.0' AND num_patches = 39)
+      ) AS test_result
+  FROM skeleton, version_info
+)
+SELECT 'Extrude building and roof', num_patches FROM skeleton;
diff --git a/sfcgal/regress/extrudestraigthskeleton_expected b/sfcgal/regress/extrudestraigthskeleton_expected
index 0b3805b35..840482c1d 100644
--- a/sfcgal/regress/extrudestraigthskeleton_expected
+++ b/sfcgal/regress/extrudestraigthskeleton_expected
@@ -1,2 +1,2 @@
 Extrude roof|POLYHEDRALSURFACE Z (((4 5 0,5 5 0,4 4 0,4 5 0)),((2 1 0,5 0 0,0 0 0,2 1 0)),((5 5 0,5 0 0,4 4 0,5 5 0)),((2 1 0,0 0 0,1 1 0,2 1 0)),((1 2 0,1 1 0,0 0 0,1 2 0)),((0 4 0,2 2 0,1 2 0,0 4 0)),((0 4 0,1 2 0,0 0 0,0 4 0)),((4 4 0,5 0 0,2 2 0,4 4 0)),((4 4 0,2 2 0,0 4 0,4 4 0)),((2 2 0,5 0 0,2 1 0,2 2 0)),((0.5 2.5 0.5,0 0 0,0.5 0.5 0.5,0.5 2.5 0.5)),((1 3 1,0 4 0,0.5 2.5 0.5,1 3 1)),((0.5 2.5 0.5,0 4 0,0 0 0,0.5 2.5 0.5)),((2.5 0.5 0.5,5 0 0,3.5 1.5 1.5,2.5 0.5 0.5)),((0 0 0,5 0 0,2.5 0.5 0.5,0 0 0)),((0.5 0.5 0.5,0 0 0,2.5 0.5 0.5,0.5 0.5 0.5)),((4.5 3.5 0.5,5 5 0,4.5 4.5 0.5,4.5 3.5 0.5)),((3.5 2.5 1.5,3.5 1.5 1.5,4.5 3.5 0.5,3.5 2.5 1.5)),((4.5 3.5 0.5,5 0 0,5 5 0,4.5 3.5 0.5)),((3.5 1.5 1.5,5 0 0,4.5 3.5 0.5,3.5 1.5 1.5)),((5 5 0,4 5 0,4.5 4.5 0.5,5 5 0)),((4.5 4.5 0.5,4 4 0,4.5 3.5 0.5,4.5 4.5 0.5)),((4.5 4.5 0.5,4 5 0,4 4 0,4.5 4.5 0.5)),((3 3 1,0 4 0,1 3 1,3 3 1)),((3.5 2.5 1.5,4.5 3.5 0.5,3 3 1,3.5 2.5 1.5)),((3 3 1,4 4 0,0 4 0,3 3 1)),((4.5 3.5 0.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3.5,3 3 3,3.5 1.5 3.5,3.5 2.5 3.5)),((3.5 1.5 3.5,2 2 2,2.5 0.5 2.5,3.5 1.5 3.5)),((3 3 3,2 2 2,3.5 1.5 3.5,3 3 3)))
+Extrude building and roof|t

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

Summary of changes:
 doc/reference_sfcgal.xml                        |  2 +-
 sfcgal/regress/extrudestraigthskeleton.sql      | 41 ++++++++++++++++++++++++-
 sfcgal/regress/extrudestraigthskeleton_expected |  2 +-
 3 files changed, 42 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list