[postgis-tickets] r14335 - Set edge endpoints as isolated on ST_RemoveIsoEdge
Sandro Santilli
strk at keybit.net
Thu Oct 29 01:37:00 PDT 2015
Author: strk
Date: 2015-10-29 01:36:59 -0700 (Thu, 29 Oct 2015)
New Revision: 14335
Modified:
branches/2.0/NEWS
branches/2.0/topology/sql/sqlmm.sql.in.c
branches/2.0/topology/test/regress/sqlmm.sql
branches/2.0/topology/test/regress/sqlmm_expected
Log:
Set edge endpoints as isolated on ST_RemoveIsoEdge
See #3351
Modified: branches/2.0/NEWS
===================================================================
--- branches/2.0/NEWS 2015-10-28 19:09:53 UTC (rev 14334)
+++ branches/2.0/NEWS 2015-10-29 08:36:59 UTC (rev 14335)
@@ -3,6 +3,7 @@
* Bug Fixes *
+ - #3351, set endnodes isolation on ST_RemoveIsoEdge
- #3196, do not let DropTopology drop non-topology schemes
- #3198, ST_AddEdgeModFace docs report wrong side of new face
- #3159, do not force a bbox cache on ST_Affine
Modified: branches/2.0/topology/sql/sqlmm.sql.in.c
===================================================================
--- branches/2.0/topology/sql/sqlmm.sql.in.c 2015-10-28 19:09:53 UTC (rev 14334)
+++ branches/2.0/topology/sql/sqlmm.sql.in.c 2015-10-29 08:36:59 UTC (rev 14335)
@@ -1770,7 +1770,7 @@
END IF;
--
- -- Check node existance
+ -- Check edge existance
--
ok = false;
FOR edge IN EXECUTE 'SELECT * FROM '
@@ -1785,7 +1785,7 @@
END IF;
--
- -- Check node isolation
+ -- Check edge isolation
--
IF edge.left_face != edge.right_face THEN
RAISE EXCEPTION
@@ -1811,7 +1811,16 @@
EXECUTE 'DELETE FROM ' || quote_ident(atopology) || '.edge_data '
|| ' WHERE edge_id = ' || anedge;
+ --
+ -- Set endnodes isolated
+ --
+ EXECUTE 'UPDATE ' || quote_ident(atopology) || '.node '
+ || ' SET containing_face = ' || edge.left_face
+ || ' WHERE node_id in ( '
+ || edge.start_node || ',' || edge.end_node || ')';
+
RETURN 'Isolated edge ' || anedge || ' removed';
+
END
$$
LANGUAGE 'plpgsql' VOLATILE;
Modified: branches/2.0/topology/test/regress/sqlmm.sql
===================================================================
--- branches/2.0/topology/test/regress/sqlmm.sql 2015-10-28 19:09:53 UTC (rev 14334)
+++ branches/2.0/topology/test/regress/sqlmm.sql 2015-10-29 08:36:59 UTC (rev 14335)
@@ -135,7 +135,26 @@
-------------------------------------------------------------
SELECT '-- ST_RemoveIsoEdge ---------------------';
+CREATE TEMP TABLE edge1_endnodes AS
+ WITH edge AS (
+ SELECT start_node,end_node
+ FROM sqlmm_topology.edge_data
+ WHERE edge_id = 1
+ )
+ SELECT start_node id FROM edge UNION
+ SELECT end_node FROM edge;
+SELECT '#3351.1', node_id, containing_face
+ FROM sqlmm_topology.node where node_id in (
+ SELECT id FROM edge1_endnodes
+ )
+ ORDER BY node_id;
SELECT topology.ST_RemoveIsoEdge('sqlmm_topology', 1);
+SELECT '#3351.2', node_id, containing_face
+ FROM sqlmm_topology.node where node_id in (
+ SELECT id FROM edge1_endnodes
+ )
+ ORDER BY node_id;
+DROP TABLE edge1_endnodes;
-------------------------------------------------------------
-- ST_NewEdgesSplit
Modified: branches/2.0/topology/test/regress/sqlmm_expected
===================================================================
--- branches/2.0/topology/test/regress/sqlmm_expected 2015-10-28 19:09:53 UTC (rev 14334)
+++ branches/2.0/topology/test/regress/sqlmm_expected 2015-10-29 08:36:59 UTC (rev 14335)
@@ -47,7 +47,11 @@
Isolated Node 8 moved to location 7,11
Isolated Node 8 moved to location 7,10
-- ST_RemoveIsoEdge ---------------------
+#3351.1|4|
+#3351.1|5|
Isolated edge 1 removed
+#3351.2|4|0
+#3351.2|5|0
-- ST_NewEdgesSplit ---------------------
9
Topology 'sqlmm_topology' dropped
More information about the postgis-tickets
mailing list