aline ALIAS FOR $2;
edgeid int;
rec RECORD;
+ ix geometry;
BEGIN
--
-- Atopology and apoint are required
RETURN rec.edge_id;
END IF;
- RAISE EXCEPTION 'Edge intersects (not on endpoints) with existing edge % ', rec.edge_id;
+ -- WARNING: the constructive operation might throw an exception
+ BEGIN
+ ix = ST_Intersection(rec.geom, aline);
+ EXCEPTION
+ WHEN OTHERS THEN
+ RAISE NOTICE 'Could not compute intersection between input edge (%) and edge % (%)', aline::text, rec.edge_id, rec.geom::text;
+
+ END;
- END LOOP;
+ RAISE EXCEPTION 'Edge intersects (not on endpoints) with existing edge % at or near point %', rec.edge_id, ST_AsText(ST_PointOnSurface(ix));
+
+ END LOOP;
--
-- Get new edge id from sequence
t
e1|1
e*1|1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
-ERROR: Edge intersects (not on endpoints) with existing edge 1
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(1 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(1 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(1 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(0 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(0 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(5 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(5 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(0 0)
+ERROR: Edge intersects (not on endpoints) with existing edge 1 at or near point POINT(5 0)
e2|2
e3|3
e4|4
e6|6
#770-1|7
#770-2|8
-ERROR: Edge intersects (not on endpoints) with existing edge 7
-ERROR: Edge intersects (not on endpoints) with existing edge 7
-ERROR: Edge intersects (not on endpoints) with existing edge 7
+ERROR: Edge intersects (not on endpoints) with existing edge 7 at or near point POINT(8 10)
+ERROR: Edge intersects (not on endpoints) with existing edge 7 at or near point POINT(8 10)
+ERROR: Edge intersects (not on endpoints) with existing edge 7 at or near point POINT(10 12)
#770-1*|7
1|0|0|1|1|LINESTRING(0 0,8 0)
2|0|0|2|2|LINESTRING(8 0,8 10)