]> granicus.if.org Git - postgis/commitdiff
Enhance error message on unsupported geometry type (#1899)
authorSandro Santilli <strk@keybit.net>
Thu, 29 Nov 2012 19:29:22 +0000 (19:29 +0000)
committerSandro Santilli <strk@keybit.net>
Thu, 29 Nov 2012 19:29:22 +0000 (19:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10763 b70326c6-7e19-0410-871a-916f4a2858ee

topology/sql/topogeometry/totopogeom.sql.in.c
topology/test/regress/totopogeom.sql
topology/test/regress/totopogeom_expected

index 40efd8da175d5deb596f950de01d6bc7db446714..20bdf939db25f951075b2085e5b3ecb1ba147d7a 100644 (file)
@@ -111,7 +111,7 @@ BEGIN
   ELSE
       -- Should never happen
       RAISE EXCEPTION
-        'Unexpected feature dimension %', ST_Dimension(ageom);
+        'Unsupported feature type %', typ;
   END IF;
 
   -- Now that we have a topogeometry, we loop over distinct components 
index e2ee7561d2a165914a0becac03aab63ad1e1ca9c..54c92e825fe47f34281962a17d8587da3c056ce2 100644 (file)
@@ -40,6 +40,11 @@ select totopogeom('MULTIPOINT(0 0, 10 10)'::geometry, 'tt', 3); -- invalid (line
 select totopogeom('MULTIPOINT(0 0, 10 10)'::geometry, 'tt', 4); -- invalid (areal) layer
 select totopogeom('POLYGON((0 0, 10 10, 10 0, 0 0))'::geometry, 'tt', 1); -- invalid (puntal) layer
 select totopogeom('POLYGON((0 0, 10 10, 10 0, 0 0))'::geometry, 'tt', 3); -- invalid (lineal) layer
+-- Unsupported feature types
+select totopogeom('TIN( ((0 0 0, 0 0 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 0 0 0)) )'::geometry, 'tt', 4); -- TODO: support !
+select totopogeom('TRIANGLE ((0 0, 0 9, 9 0, 0 0))'::geometry, 'tt', 4); -- TODO: support !
+select totopogeom('CIRCULARSTRING(0 0, 1 1, 1 0)'::geometry, 'tt', 3); -- Unsupported feature type
+
 
 -- Convert a point
 with inp as ( select 'POINT(0 0)' ::geometry as g)
index c04be1421bb40afa91ed3d83c1d12cc630b425ff..1ce95d7fb5c6c25afdbca02d12bf0c942e38825c 100644 (file)
@@ -15,6 +15,9 @@ ERROR:  Layer "3" of topology "tt" is lineal, cannot hold a puntal feature.
 ERROR:  Layer "4" of topology "tt" is areal, cannot hold a puntal feature.
 ERROR:  Layer "1" of topology "tt" is puntal, cannot hold an areal feature.
 ERROR:  Layer "3" of topology "tt" is lineal, cannot hold an areal feature.
+ERROR:  Unsupported feature type TIN
+ERROR:  Unsupported feature type TRIANGLE
+ERROR:  Unsupported feature type CIRCULARSTRING
 POINT(0 0)|t
 LINESTRING(0 10,10 10)|t
 POLYGON((0 20,10 20,5 30,0 20),(2 22,8 22,5 28,2 22))|t