]> granicus.if.org Git - postgis/commitdiff
Add "face has no rings" validity checking
authorSandro Santilli <strk@keybit.net>
Fri, 27 Jan 2012 20:14:52 +0000 (20:14 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 27 Jan 2012 20:14:52 +0000 (20:14 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8947 b70326c6-7e19-0410-871a-916f4a2858ee

topology/test/regress/legacy_invalid_expected
topology/topology.sql.in.c

index c9841cfcbdac7af005cda26820d0dc9cf6136ce1..5ae7d22785b699b6081d4c5e618e32669366c176 100644 (file)
@@ -15,6 +15,7 @@ edge crosses edge|30|32
 edge start node geometry mis-match|30|4
 edge end node geometry mis-match|30|3
 face without edges|10|
+face has no rings|10|
 face within face|11|2
 face overlaps face|2|12
 COMMIT
index bd6e0ab4265a7ee9ee1adaa9ffc3c873e5d394e8..1eda5d473fe94b1990e5d38c7d35eaf3208099ec 100644 (file)
@@ -1479,10 +1479,23 @@ BEGIN
        EXECUTE 'CREATE INDEX "face_check_bt" ON ' 
          || 'face_check (face_id);';
 
+       -- Scan the table looking for NULL geometries
+       FOR rec IN EXECUTE
+               'SELECT f1.face_id FROM '
+               || 'face_check f1 WHERE f1.geom IS NULL'
+       LOOP
+               -- Face missing !
+               retrec.error := 'face has no rings';
+               retrec.id1 := rec.face_id;
+               retrec.id2 := NULL;
+               RETURN NEXT retrec;
+       END LOOP;
+
+
        -- Scan the table looking for overlap or containment
        -- TODO: also check for MBR consistency
        FOR rec IN EXECUTE
-               'SELECT f1.face_id as id1, f2.face_id as id2, '
+               'SELECT f1.geom, f1.face_id as id1, f2.face_id as id2, '
                || ' ST_Relate(f1.geom, f2.geom) as im'
                || ' FROM '
                || 'face_check f1, '