[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-335-g04aa7f6
git at osgeo.org
git at osgeo.org
Wed Jul 14 06:11:49 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 04aa7f611dbedd47b9b56993696032fbd3ef4331 (commit)
from 34382d44f9909c9775dab30499f2f57d856ab12a (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 04aa7f611dbedd47b9b56993696032fbd3ef4331
Author: Sandro Santilli <strk at kbt.io>
Date: Wed Jul 14 14:36:08 2021 +0200
Fix scrolling of closed lines on topology population
Includes test for adding same closed line with first point slighly
off but within tolerance.
Use of tolerance moves the first point, which is later NOT
found by the scroll call, unless we recomputed as in this
commit, which recomputes start point after snap.
References #2175
diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
index d4c9b04..3c21d1c 100644
--- a/liblwgeom/lwgeom_topo.c
+++ b/liblwgeom/lwgeom_topo.c
@@ -5748,6 +5748,16 @@ _lwt_AddLine(LWT_TOPOLOGY* topo, LWLINE* line, double tol, int* nedges,
lwgeom_free(noded);
noded = tmp;
LWDEBUGG(1, noded, "Elements-snapped");
+ if ( input_was_closed )
+ {{
+ /* Recompute start point in case it moved */
+ LWLINE *scrolled = lwgeom_as_lwline(noded);
+ if (scrolled)
+ {
+ getPoint4d_p( scrolled->points, 0, &originalStartPoint);
+ LWDEBUGF(1, "Closed input line start point after snap %g,%g", originalStartPoint.x, originalStartPoint.y);
+ }
+ }}
/* will not release the geoms array */
lwcollection_release(col);
diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql
index 727562e..60cabfe 100644
--- a/topology/test/regress/topogeo_addlinestring.sql
+++ b/topology/test/regress/topogeo_addlinestring.sql
@@ -401,12 +401,15 @@ ORDER BY t;
SELECT 't4758.end', topology.DropTopology('t4758');
-- See https://trac.osgeo.org/postgis/ticket/2175
-SELECT 't2175.start', topology.CreateTopology('bug2175') > 0;
+BEGIN;
+SELECT NULL FROM topology.CreateTopology('bug2175');
SELECT 't2175.1', count(*) from topology.TopoGeo_addLinestring('bug2175',
'LINESTRING(10 10,10 0,0 0,0 10,10 10)', 0);
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');
+SELECT 't2175.3', count(*) from topology.TopoGeo_addLinestring('bug2175',
+ 'LINESTRING(9.99 10,10 0,0 0,0 10,9.99 10)', 0.1);
+ROLLBACK;
-- See https://trac.osgeo.org/postgis/ticket/4941
SELECT NULL FROM createtopology('b4941');
diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected
index 8471cc8..8b9e06a 100644
--- a/topology/test/regress/topogeo_addlinestring_expected
+++ b/topology/test/regress/topogeo_addlinestring_expected
@@ -213,10 +213,9 @@ t4758.2|2
t4758.2|4
t4758.2|5
t4758.end|Topology 't4758' dropped
-t2175.start|t
t2175.1|1
t2175.2|1
-t2175.end|Topology 'bug2175' dropped
+t2175.3|1
b4941|outer_ring|1
b4941|inner_ring|1
b4941|crossing_line|5
-----------------------------------------------------------------------
Summary of changes:
liblwgeom/lwgeom_topo.c | 10 ++++++++++
topology/test/regress/topogeo_addlinestring.sql | 7 +++++--
topology/test/regress/topogeo_addlinestring_expected | 3 +--
3 files changed, 16 insertions(+), 4 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list