1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
\set VERBOSITY terse
set client_min_messages to ERROR;
\i :top_builddir/topology/test/load_topology.sql
\i ../load_features.sql
\i ../hierarchy.sql
--\i ../more_features.sql
SELECT 'valid-start', * FROM topology.ValidateTopologyRelation('city_data');
-- Delete all primitives
DELETE FROM city_data.edge_data;
DELETE FROM city_data.node;
DELETE FROM city_data.face WHERE face_id > 0;
SELECT 'invalid-primitives', * FROM topology.ValidateTopologyRelation('city_data')
ORDER BY 3,4,5;
-- Delete features from primitive tables
WITH
deleted_land_parcels AS (
DELETE FROM features.land_parcels
RETURNING feature
),
deleted_traffic_signs AS (
DELETE FROM features.traffic_signs
RETURNING feature
),
deleted_city_streets AS (
DELETE FROM features.city_streets
RETURNING feature
)
SELECT NULL FROM (
SELECT ClearTopoGeom(feature) FROM deleted_land_parcels
UNION
SELECT ClearTopoGeom(feature) FROM deleted_traffic_signs
UNION
SELECT ClearTopoGeom(feature) FROM deleted_city_streets
) foo
;
SELECT 'invalid-hierarchical', * FROM topology.ValidateTopologyRelation('city_data')
ORDER BY 3,4,5;
--SELECT * FROM topology.layer WHERE child_id IS NOT NULL;
SELECT topology.DropTopology('city_data');
DROP SCHEMA features CASCADE;
|