[Gdal-dev] Revision 1.8 to GMLHandler.cpp seems to have broken UK Ordnance Survey GML files

Frank Warmerdam warmerdam at pobox.com
Mon Apr 2 23:17:59 EDT 2007


Roger James wrote:
> The latest revision (1.8) to GMLHandler.cpp has broken the reading UK
> ordnance survey GML files.
> Polygon features in the Ordnance Survey schema look like this.
> 
>       <osgb:polygon>
>         <gml:Polygon srsName="osgb:BNG">
>           <gml:outerBoundaryIs>
>             <gml:LinearRing>
>               <gml:coordinates>347346.09,461580.61 347345.35,461585.4
> 347337.97,461584.11 347338.7,461579.38 347346.09,461580.61</gml:coordinates>
>             </gml:LinearRing>
>           </gml:outerBoundaryIs>
>         </gml:Polygon>
>       </osgb:polygon>
> 
> This used to work in GMLReader::PrescanForSchema because osgb:polygon was
> not recognised as a Geometry Element by GMLHander:: IsGeometryElement.
> 
> However at 1.8 because the namespace has been stripped it is now recognised
> as a polygon geometry element. This causes a subsequent failure in
> GML2OGRGeometry_XMLNode because outerBoundaryIsland is no longer an
> immediate child of the polygon node.
> 
> I am not sure if this is a fatal error because I got fed up of looking at
> all the error messages on the large file I was processing!

Roger,

I'm afraid your primary resort is to stick with the older version or use
a hacked newer version.  The GML reader is known to be unsafe because it
uses jiffy rules to decide what is a feature and what is a geometry instead
of parsing the schema file.  That it worked before with a feature class
name of polygon was quick lucky (in a sense), but I'm not willing to revert
the change.

What we ideally need is a new schema aware GML reader.  Till then we are only
going to support rather unambitious types of gml files.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list