Opened 10 years ago

Closed 10 years ago

#4934 closed defect (fixed)

OGR cannot handle unknown attributes in GML geometry elements

Reported by: gmoffatt Owned by: warmerdam
Priority: normal Milestone: 1.9.3
Component: OGR_SF Version: 1.9.0
Severity: normal Keywords:
Cc:

Description

Since GDAL 1.9.0, OGR does not properly handle extra unknown attributes in GML geometry elements.

In one case, when viewing such a GML through MapServer, the error "msOGRFileNextShape(): OGR error. Invalid exterior ring." is returned.

According to Even Rouault: 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">

A sample of the (admittedly verbose but valid) GML is attached.

Attachments (1)

Warnings_en-CA.gml (5.0 KB ) - added by gmoffatt 10 years ago.
Sample GML with extra namespace attributes

Download all attachments as: .zip

Change History (2)

by gmoffatt, 10 years ago

Attachment: Warnings_en-CA.gml added

Sample GML with extra namespace attributes

comment:1 by Even Rouault, 10 years ago

Component: defaultOGR_SF
Milestone: 1.9.3
Resolution: fixed
Status: newclosed

Fixed in trunk (r25335) and branches/1.9 (r25336)

Note: See TracTickets for help on using tickets.