Includes regression testing for both GetGopoGeomElements
and GetGopoGeomElementArray
git-svn-id: http://svn.osgeo.org/postgis/trunk@9568
b70326c6-7e19-0410-871a-
916f4a2858ee
regress/getedgebypoint.sql \
regress/getfacebypoint.sql \
regress/getringedges.sql \
+ regress/gettopogeomelements.sql \
regress/layertrigger.sql
check: topo_predicates.sql load_topology.sql load_topology-4326.sql
--- /dev/null
+set client_min_messages to WARNING;
+
+\i load_topology.sql
+\i load_features.sql
+
+SELECT lid, tid, GetTopoGeomElements('city_data', lid, tid)
+FROM (
+ SELECT DISTINCT layer_id as lid, topogeo_id as tid
+ FROM city_data.relation
+) as f
+order by 1, 2, 3;
+
+SELECT lid, tid, 'ARY', GetTopoGeomElementArray('city_data', lid, tid)
+FROM (
+ SELECT DISTINCT layer_id as lid, topogeo_id as tid
+ FROM city_data.relation
+) as f
+order by 1, 2;
+
+-- clean up
+SELECT topology.DropTopology('city_data');
+DROP SCHEMA features CASCADE;
--- /dev/null
+BEGIN
+t
+9
+22
+26
+COMMIT
+BEGIN
+1
+2
+3
+COMMIT
+1|1|{3,3}
+1|1|{6,3}
+1|2|{4,3}
+1|2|{7,3}
+1|3|{5,3}
+1|3|{8,3}
+1|4|{2,3}
+1|5|{1,3}
+2|1|{14,1}
+2|2|{13,1}
+2|3|{6,1}
+2|4|{4,1}
+3|1|{9,2}
+3|1|{10,2}
+3|2|{4,2}
+3|2|{5,2}
+3|3|{25,2}
+3|4|{3,2}
+1|1|ARY|{{3,3},{6,3}}
+1|2|ARY|{{4,3},{7,3}}
+1|3|ARY|{{5,3},{8,3}}
+1|4|ARY|{{2,3}}
+1|5|ARY|{{1,3}}
+2|1|ARY|{{14,1}}
+2|2|ARY|{{13,1}}
+2|3|ARY|{{6,1}}
+2|4|ARY|{{4,1}}
+3|1|ARY|{{9,2},{10,2}}
+3|2|ARY|{{4,2},{5,2}}
+3|3|ARY|{{25,2}}
+3|4|ARY|{{3,2}}
+Topology 'city_data' dropped
query = 'SELECT * FROM topology.GetTopoGeomElements('
|| quote_literal(toponame) || ','
- || quote_literal(layerid) || ','
+ || quote_literal(layer_id) || ','
|| quote_literal(tgid)
|| ') as obj ORDER BY obj';
- RAISE NOTICE 'Query: %', query;
+#ifdef POSTGIS_TOPOLOGY_DEBUG
+ RAISE DEBUG 'Query: %', query;
+#endif
+
+ -- TODO: why not using array_agg here ?
i = 1;
FOR rec IN EXECUTE query