[gdal-dev] GML Invalid exterior ring

Even Rouault even.rouault at mines-paris.org
Thu Dec 20 08:52:44 PST 2012


Selon "Moffatt, Greg" <Greg.Moffatt at amec.com>:

> Hi all,
>
>
>
> I've tried this query on the ms4w and mapserver lists without luck, so please
> forgive my cross-post.  I think the issue is somehow related to GDAL/OGR, so
> I'm hoping someone on this list can shed some light.
>
>
>
> I have a GML file that's generated by SQL Server that contains one or more
> polygons.  It used to work, but since I've upgraded the ms4w installation on
> my web server, any requests to MapServer for that layer fail with the
> message: msOGRFileNextShape(): OGR error. Invalid exterior ring.
>
>
> GDAL changed from 1.8.1RC2 to 1.9.0 in that step.  I've looked through the
> GDAL release notes, but nothing is jumping out at me.
>
>
>
> Any idea why MapServer (or OGR specifically) might balk at the GML?

ok, I've reproduced the issue with your sample. Would you mind opening a ticket
at http://trac.osgeo.org/gdal/newticket about that ?

The issue is due that newer OGR versions now preserve the XML attributes of the
geometry elements of the GML, but the original parser of the GML geometries
isn't robust to ignoring attributes it doesn't know how to deal with. Namely in
your example the issue is with :

<gml:outerBoundaryIs xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogr="http://www.opengis.net/ogr"
xmlns:gml="http://www.opengis.net/gml">

If you remove all the attributes that define namespaces, it will work :
<gml:outerBoundaryIs>

I'll make the parser more robust, since the GML is well valid (but very verbose
! : why repeating the namespaces on all nodes ?)

Best regards,

Even


More information about the gdal-dev mailing list