From 10f1a2c33df3cbf8cc609f9e4297cb9ea04b94f8 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 9 May 2011 14:17:05 +0000 Subject: [PATCH] Check for "other connected edges" before TopoGeometry definitions git-svn-id: http://svn.osgeo.org/postgis/trunk@7116 b70326c6-7e19-0410-871a-916f4a2858ee --- topology/sql/sqlmm.sql | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/topology/sql/sqlmm.sql b/topology/sql/sqlmm.sql index 7d7490951..abe09b81f 100644 --- a/topology/sql/sqlmm.sql +++ b/topology/sql/sqlmm.sql @@ -206,6 +206,16 @@ BEGIN RAISE EXCEPTION 'SQL/MM Spatial exception – non-connected edges'; END IF; + -- Check if any other edge is connected to the common node + FOR rec IN EXECUTE 'SELECT edge_id FROM ' || quote_ident(toponame) + || '.edge_data WHERE ( edge_id != ' || e1id + || ' AND edge_id != ' || e2id || ') AND ( start_node = ' + || commonnode || ' OR end_node = ' || commonnode || ' )' + LOOP + RAISE EXCEPTION + 'SQL/MM Spatial exception – other edges connected (ie: %)', rec.edge_id; + END LOOP; + -- NOT IN THE SPECS: -- check if any topo_geom is defined only by one of the -- input edges. In such case there would be no way to adapt @@ -232,17 +242,6 @@ BEGIN e1id, e2id; END LOOP; - - -- Check if any other edge is connected to the common node - FOR rec IN EXECUTE 'SELECT edge_id FROM ' || quote_ident(toponame) - || '.edge_data WHERE ( edge_id != ' || e1id - || ' AND edge_id != ' || e2id || ') AND ( start_node = ' - || commonnode || ' OR end_node = ' || commonnode || ' )' - LOOP - RAISE EXCEPTION - 'SQL/MM Spatial exception – other edges connected (ie: %)', rec.edge_id; - END LOOP; - -- Update data of the first edge { rec := e1rec; rec.geom = ST_LineMerge(ST_Collect(e1rec.geom, e2rec.geom)); -- 2.50.1