[postgis-tickets] r14336 - Set edge endpoints as isolated on ST_RemoveIsoEdge
Sandro Santilli
strk at keybit.net
Thu Oct 29 01:37:37 PDT 2015
Author: strk
Date: 2015-10-29 01:37:37 -0700 (Thu, 29 Oct 2015)
New Revision: 14336
Modified:
branches/2.1/NEWS
branches/2.1/topology/sql/sqlmm.sql.in
branches/2.1/topology/test/regress/sqlmm.sql
branches/2.1/topology/test/regress/sqlmm_expected
Log:
Set edge endpoints as isolated on ST_RemoveIsoEdge
See #3351
Modified: branches/2.1/NEWS
===================================================================
--- branches/2.1/NEWS 2015-10-29 08:36:59 UTC (rev 14335)
+++ branches/2.1/NEWS 2015-10-29 08:37:37 UTC (rev 14336)
@@ -3,6 +3,7 @@
* Bug Fixes *
+ - #3351, set endnodes isolation on ST_RemoveIsoEdge
- #3198, ST_AddEdgeModFace docs report wrong side of new face
- #3196, do not let DropTopology drop non-topology schemes
- #3222, Fix uninitialized stddev in stats computation
Modified: branches/2.1/topology/sql/sqlmm.sql.in
===================================================================
--- branches/2.1/topology/sql/sqlmm.sql.in 2015-10-29 08:36:59 UTC (rev 14335)
+++ branches/2.1/topology/sql/sqlmm.sql.in 2015-10-29 08:37:37 UTC (rev 14336)
@@ -1767,7 +1767,7 @@
END IF;
--
- -- Check node existance
+ -- Check edge existance
--
ok = false;
FOR edge IN EXECUTE 'SELECT * FROM '
@@ -1782,7 +1782,7 @@
END IF;
--
- -- Check node isolation
+ -- Check edge isolation
--
IF edge.left_face != edge.right_face THEN
RAISE EXCEPTION
@@ -1808,7 +1808,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.1/topology/test/regress/sqlmm.sql
===================================================================
--- branches/2.1/topology/test/regress/sqlmm.sql 2015-10-29 08:36:59 UTC (rev 14335)
+++ branches/2.1/topology/test/regress/sqlmm.sql 2015-10-29 08:37:37 UTC (rev 14336)
@@ -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.1/topology/test/regress/sqlmm_expected
===================================================================
--- branches/2.1/topology/test/regress/sqlmm_expected 2015-10-29 08:36:59 UTC (rev 14335)
+++ branches/2.1/topology/test/regress/sqlmm_expected 2015-10-29 08:37:37 UTC (rev 14336)
@@ -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