Ticket #1735: CheckNoding.sql

File CheckNoding.sql, 419 bytes (added by strk, 12 years ago)

Function to check correct noding

Line 
1CREATE FUNCTION CheckNoding(g geometry)
2RETURNS TABLE(ap int[], bp int[], im text)
3AS
4$$
5with
6 noded as ( select $1 as g ),
7 dumpd as ( select (st_dump(g)).* from noded ),
8 matrx as ( select a.path as ap, b.path as bp,
9 st_relate(a.geom, b.geom, 2) as im
10 from dumpd a, dumpd b where a.path < b.path )
11select ap, bp, im from matrx where ST_RelateMatch(im, 'T********');
12$$
13LANGUAGE 'SQL';