Ticket #1735: CheckNoding.sql
| File CheckNoding.sql, 419 bytes (added by , 12 years ago) |
|---|
| Line | |
|---|---|
| 1 | CREATE FUNCTION CheckNoding(g geometry) |
| 2 | RETURNS TABLE(ap int[], bp int[], im text) |
| 3 | AS |
| 4 | $$ |
| 5 | with |
| 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 ) |
| 11 | select ap, bp, im from matrx where ST_RelateMatch(im, 'T********'); |
| 12 | $$ |
| 13 | LANGUAGE 'SQL'; |
