]> granicus.if.org Git - postgis/commitdiff
#2681 fix.
authorOlivier Courtin <olivier.courtin@camptocamp.com>
Wed, 26 Mar 2014 10:11:51 +0000 (10:11 +0000)
committerOlivier Courtin <olivier.courtin@camptocamp.com>
Wed, 26 Mar 2014 10:11:51 +0000 (10:11 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12361 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_in_gml.c
regress/in_gml.sql
regress/in_gml_expected

index ee30a0c148f5f13095e40c0f0e683bc294b00b63..caa043e8b857b342a39253162817c9816c600e90 100644 (file)
@@ -1335,6 +1335,10 @@ static LWGEOM* parse_gml_patch(xmlNodePtr xnode, bool *hasz, int *root_srid)
                }
        }
 
+       /* Interior but no Exterior ! */
+       if ( ! ppa )
+               gml_lwerror("invalid GML representation", 48);
+
        /* PolygonPatch/interior */
        for (ring=1, xa = xnode->children ; xa != NULL ; xa = xa->next)
        {
index a37ce9594274ab62769489abfec245b604cb3d65..736d1d1aa113d11a493a8eaf7d4c2b5223fe26bd 100644 (file)
@@ -301,6 +301,8 @@ SELECT 'surface_21', ST_AsEWKT(ST_GeomFromGML('<gml:Surface><gml:patches><gml:Po
 -- ERROR: interpolation not planar
 SELECT 'surface_22', ST_AsEWKT(ST_GeomFromGML('<gml:Surface><gml:patches><gml:PolygonPatch interpolation="not_planar"><gml:exterior><gml:LinearRing><gml:coordinates>1,2 3,4 5,6 1,2</gml:coordinates></gml:LinearRing></gml:exterior></gml:PolygonPatch></gml:patches></gml:Surface>'));
 
+-- ERROR: interior but no exterior 
+SELECT 'surface_23', ST_AsEWKT(ST_GeomFromGML('<gml:Surface><gml:patches><gml:PolygonPatch><gml:interior><gml:LinearRing><gml:coordinates>1,2 3,4 5,6 1,2</gml:coordinates></gml:LinearRing></gml:interior></gml:PolygonPatch></gml:patches></gml:Surface>'));
 
 
 --
index 60b0442cd65f4f1c13d8f30a6fca18ae08e1ceaf..6fa4e2d6d5404a40afb1cc4d59712dbbaea6e890 100644 (file)
@@ -88,6 +88,7 @@ surface_19|POLYGON((1 2,3 4,5 6,1 2),(7 8,10 11,13 14,7 8))
 ERROR:  invalid GML representation
 surface_21|POLYGON((1 2,3 4,5 6,1 2))
 ERROR:  invalid GML representation
+ERROR:  invalid GML representation
 mpoint_1|MULTIPOINT(1 2)
 mpoint_2|MULTIPOINT(1 2,3 4)
 mpoint_3|SRID=4326;MULTIPOINT(1 2)