[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.2-6-g7c4106c
git at osgeo.org
git at osgeo.org
Mon Sep 21 05:03:29 PDT 2020
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.0 has been updated
via 7c4106c5a3a0118f1b928c960df10cd8210e7e44 (commit)
from d4057706afab0d9cb54448bb05152e33b855c4eb (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 7c4106c5a3a0118f1b928c960df10cd8210e7e44
Author: Sandro Santilli <strk at kbt.io>
Date: Mon Sep 21 12:59:29 2020 +0200
Handle line collapse due to snap-to-existing node
References #4757 in 3.0 branch (3.0.3dev)
Includes regression test
diff --git a/NEWS b/NEWS
index 3091310..59caccf 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,8 @@
-PostGIS 3.0.3
+PostGIS 3.0.3dev
2020/xx/xx
* Bug Fixes and Enhancements *
- #4742 tiger geocoder reverted to 2018 version on tiger upgrade
+ - #4757, Handle line collapse due to snap-to-existing node (Sandro Santilli)
PostGIS 3.0.2
2020/08/15
diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
index a27e628..e111e07 100644
--- a/liblwgeom/lwgeom_topo.c
+++ b/liblwgeom/lwgeom_topo.c
@@ -5461,6 +5461,14 @@ _lwt_AddLineEdge( LWT_TOPOLOGY* topo, LWLINE* edge, double tol,
if ( tmp ) lwgeom_free(tmp);
tmp = tmp2;
+ /* check if the so-decimated edge collapsed to single-point */
+ if ( nid[0] == nid[1] && edge->points->npoints == 2 )
+ {
+ lwgeom_free(tmp);
+ LWDEBUG(1, "Repeated-point removed edge collapsed");
+ return 0;
+ }
+
/* check if the so-decimated edge _now_ exists */
id = _lwt_GetEqualEdge ( topo, edge );
LWDEBUGF(1, "_lwt_GetEqualEdge returned %" LWTFMT_ELEMID, id);
diff --git a/topology/test/regress/topogeo_addlinestring.sql b/topology/test/regress/topogeo_addlinestring.sql
index b57f78a..460229a 100644
--- a/topology/test/regress/topogeo_addlinestring.sql
+++ b/topology/test/regress/topogeo_addlinestring.sql
@@ -34,7 +34,7 @@ BEGIN
-- Check effect on edges (there should be one split)
sql := 'WITH node_limits AS ( SELECT max FROM city_data.limits WHERE what = ''node''::text ),
edge_limits AS ( SELECT max FROM city_data.limits WHERE what = ''edge''::text )
- SELECT $1 || ''|E|'' ' || CASE WHEN add_id THEN ' || e.edge_id || ''|sn'' || e.start_node || ''|en'' || e.end_node::text ' ELSE '' END || ' AS xx ' ||
+ SELECT $1 || ''|E|'' ' || CASE WHEN add_id THEN ' || e.edge_id || ''|sn'' || e.start_node || ''|en'' || e.end_node::text ' ELSE '' END || ' AS xx ' ||
' FROM city_data.edge e, node_limits nl, edge_limits el
WHERE e.start_node > nl.max
OR e.end_node > nl.max
@@ -330,7 +330,7 @@ SELECT 't3412.L1', TopoGeo_AddLinestring('bug3412',
/**SELECT 't3412.L2', TopoGeo_AddLinestring('bug3412',
'0102000000020000003AB42BBFEE4C22410010C5A997A6524167BB5DBDEE4C224117FE3DA85FA75241'
::geometry, 0);**/
-SELECT 't3412.L2', COUNT(*)
+SELECT 't3412.L2', COUNT(*)
FROM TopoGeo_AddLinestring('bug3412',
'0102000000020000003AB42BBFEE4C22410010C5A997A6524167BB5DBDEE4C224117FE3DA85FA75241'
::geometry, 0);
@@ -362,7 +362,7 @@ SELECT 't3838.L1', topology.TopoGeo_addLinestring('bug3838',
/** SELECT 't3838.L2', topology.TopoGeo_addLinestring('bug3838',
'LINESTRING(622608 6554988, 622596 6554984)'
::geometry , 10);**/
-SELECT 't3838.L2', COUNT(*)
+SELECT 't3838.L2', COUNT(*)
FROM topology.TopoGeo_addLinestring('bug3838',
'LINESTRING(622608 6554988, 622596 6554984)'
::geometry , 10);
@@ -382,3 +382,9 @@ SELECT 't1855_2.1', topology.topogeo_AddLinestring('bug1855',
'LINESTRING(10 51, -100 50, 10 49)', 2);
SELECT 't1855_2.end', topology.DropTopology('bug1855');
+-- See https://trac.osgeo.org/postgis/ticket/4757
+SELECT 't4757.start', topology.CreateTopology('bug4757') > 0;
+SELECT 't4757.0', topology.TopoGeo_addPoint('bug4757', 'POINT(0 0)');
+SELECT 't4757.1', topology.TopoGeo_addLinestring('bug4757',
+ 'LINESTRING(0 -0.1,1 0,1 1,0 1,0 -0.1)', 1);
+SELECT 't4757.end', topology.DropTopology('bug4757');
diff --git a/topology/test/regress/topogeo_addlinestring_expected b/topology/test/regress/topogeo_addlinestring_expected
index 8bb9597..b591715 100644
--- a/topology/test/regress/topogeo_addlinestring_expected
+++ b/topology/test/regress/topogeo_addlinestring_expected
@@ -212,3 +212,6 @@ t1855_2.1|3
t1855_2.1|5
t1855_2.1|6
t1855_2.end|Topology 'bug1855' dropped
+t4757.start|t
+t4757.0|1
+t4757.end|Topology 'bug4757' dropped
-----------------------------------------------------------------------
Summary of changes:
NEWS | 3 ++-
liblwgeom/lwgeom_topo.c | 8 ++++++++
topology/test/regress/topogeo_addlinestring.sql | 12 +++++++++---
topology/test/regress/topogeo_addlinestring_expected | 3 +++
4 files changed, 22 insertions(+), 4 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list