From: Sandro Santilli Date: Mon, 9 May 2011 14:17:05 +0000 (+0000) Subject: Check for "other connected edges" before TopoGeometry definitions X-Git-Tag: 2.0.0alpha1~1692 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10f1a2c33df3cbf8cc609f9e4297cb9ea04b94f8;p=postgis Check for "other connected edges" before TopoGeometry definitions git-svn-id: http://svn.osgeo.org/postgis/trunk@7116 b70326c6-7e19-0410-871a-916f4a2858ee --- 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));