]> granicus.if.org Git - postgis/commitdiff
Check for "other connected edges" before TopoGeometry definitions
authorSandro Santilli <strk@keybit.net>
Mon, 9 May 2011 14:17:05 +0000 (14:17 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 9 May 2011 14:17:05 +0000 (14:17 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7116 b70326c6-7e19-0410-871a-916f4a2858ee

topology/sql/sqlmm.sql

index 7d749095148a6723e40ba5ddf71817de467c525e..abe09b81fc9154191262237bf3cf1486ee79303c 100644 (file)
@@ -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));