From: Sandro Santilli Date: Thu, 29 Nov 2012 19:29:22 +0000 (+0000) Subject: Enhance error message on unsupported geometry type (#1899) X-Git-Tag: 2.1.0beta2~343 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c698b80aebb2675a66f83710534db711bad8d74d;p=postgis Enhance error message on unsupported geometry type (#1899) git-svn-id: http://svn.osgeo.org/postgis/trunk@10763 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/topology/sql/topogeometry/totopogeom.sql.in.c b/topology/sql/topogeometry/totopogeom.sql.in.c index 40efd8da1..20bdf939d 100644 --- a/topology/sql/topogeometry/totopogeom.sql.in.c +++ b/topology/sql/topogeometry/totopogeom.sql.in.c @@ -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 diff --git a/topology/test/regress/totopogeom.sql b/topology/test/regress/totopogeom.sql index e2ee7561d..54c92e825 100644 --- a/topology/test/regress/totopogeom.sql +++ b/topology/test/regress/totopogeom.sql @@ -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) diff --git a/topology/test/regress/totopogeom_expected b/topology/test/regress/totopogeom_expected index c04be1421..1ce95d7fb 100644 --- a/topology/test/regress/totopogeom_expected +++ b/topology/test/regress/totopogeom_expected @@ -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