[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-272-g4c84d49

git at osgeo.org git at osgeo.org
Tue Jul 6 06:53:16 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, main has been updated
       via  4c84d496cd2d545582cdb9c005c734c720c8b58e (commit)
      from  f012188f00fced56b6d83268f955ef3e62ecdfd8 (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 4c84d496cd2d545582cdb9c005c734c720c8b58e
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Jul 6 12:40:34 2021 +0200

    Return the full ("fit") face mbr from cb_getFacesById
    
    Add test of face mbr invalidity on TopoGeo_addLineString
    
    References #4941 in main branch (3.2.0dev)

diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c
index 8e094c0..9480bf8 100644
--- a/topology/postgis_topology.c
+++ b/topology/postgis_topology.c
@@ -873,9 +873,11 @@ fillFaceFields(LWT_ISO_FACE* face, HeapTuple row, TupleDesc rowdesc, int fields)
       /* NOTE: this is a geometry of which we want to take (and clone) the BBOX */
       geom = (GSERIALIZED *)PG_DETOAST_DATUM(dat);
       g = lwgeom_from_gserialized(geom);
+      lwgeom_refresh_bbox(g); /* Ensure we use a fit mbr, see #4149 */
       box = lwgeom_get_bbox(g);
       if ( box )
       {
+        POSTGIS_DEBUGF(1, "Face %d bbox xmin is %.15g", face->face_id, box->xmin);
         face->mbr = gbox_clone(box);
       }
       else
diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql
index a994763..727562e 100644
--- a/topology/test/regress/topogeo_addlinestring.sql
+++ b/topology/test/regress/topogeo_addlinestring.sql
@@ -407,3 +407,60 @@ SELECT 't2175.1', count(*) from topology.TopoGeo_addLinestring('bug2175',
 SELECT 't2175.2', count(*) from topology.TopoGeo_addLinestring('bug2175',
   'LINESTRING(10 10,10 0,0 0,0 10,10 10)', 0);
 SELECT 't2175.end', topology.DropTopology('bug2175');
+
+-- See https://trac.osgeo.org/postgis/ticket/4941
+SELECT NULL FROM createtopology('b4941');
+SELECT 'b4941', 'outer_ring', count(*) FROM (
+  SELECT TopoGeo_addLineString('b4941',
+  'LINESTRING(
+    12.123711265448206 65.12785021295713,
+    12.123711265448206 65.21007378815003,
+    12.208829785296102 65.12785021295713,
+    12.123711265448206 65.12785021295713)
+  ')
+) foo;
+SELECT 'b4941', 'mbr-invalid-before', face_id
+FROM b4941.face
+WHERE face_id > 0
+AND NOT ST_Equals(
+    mbr,
+    ST_Envelope(
+      ST_GetFaceGeometry('b4941', face_id)
+    )
+  );
+SELECT 'b4941', 'inner_ring', count(*) FROM (
+  SELECT TopoGeo_addLineString('b4941',
+    'LINESTRING(
+      12.164016376530826 65.16373151830707,
+      12.164026259700226 65.16368501062713,
+      12.164003720888175 65.16368611107725,
+      12.164016376530826 65.16373151830707
+    )')
+) foo;
+SELECT 'b4941', 'mbr-invalid-after-hole', face_id
+FROM b4941.face
+WHERE face_id > 0
+AND NOT ST_Equals(
+    mbr,
+    ST_Envelope(
+      ST_GetFaceGeometry('b4941', face_id)
+    )
+  );
+SELECT 'b4941', 'crossing_line', count(*) FROM (
+  SELECT TopoGeo_addLineString('b4941',
+    'LINESTRING(
+      12.123387 65.128411,
+      12.164015866 65.163701383,
+      12.168618 65.167537
+    )')
+) foo;
+SELECT 'b4941', 'mbr-invalid-after-cross', face_id
+FROM b4941.face
+WHERE face_id > 0
+AND NOT ST_Equals(
+    mbr,
+    ST_Envelope(
+      ST_GetFaceGeometry('b4941', face_id)
+    )
+  );
+SELECT NULL FROM topology.DropTopology('b4941');
diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected
index 388c9e2..8471cc8 100644
--- a/topology/test/regress/topogeo_addlinestring_expected
+++ b/topology/test/regress/topogeo_addlinestring_expected
@@ -217,3 +217,6 @@ t2175.start|t
 t2175.1|1
 t2175.2|1
 t2175.end|Topology 'bug2175' dropped
+b4941|outer_ring|1
+b4941|inner_ring|1
+b4941|crossing_line|5

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

Summary of changes:
 topology/postgis_topology.c                        |  2 +
 topology/test/regress/topogeo_addlinestring.sql    | 57 ++++++++++++++++++++++
 .../test/regress/topogeo_addlinestring_expected    |  3 ++
 3 files changed, 62 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list