[Gdal-dev] UK OS Mastermap GML
Frank Warmerdam
warmerdam at pobox.com
Mon May 5 11:38:12 EDT 2003
Roger James wrote:
> Frank,
>
>
>
> I have been looking at getting ogr to read the new UK OS Mastermap GML
> formats. The current gml reader cannot do this because is does not
> recognise the OS derived schema. I noticed from some earlier posting you
> has been doing something in the gml schema area (you mention an
> XSISCHEMA schema option), however, this appears to be output only, and I
> cannot find any reference to it in the current source!
...
>
> I was thinking that a quick hack would be to just change some of the
> built in schema strings that you scan for. But that seems very ugly.
Roger,
The main problem with OS Mastermap data is that OGR's GML reader looks
specifically for featureMember elements to identify features. When I add
osgb:cartographicMember to the IsFeature() test, the Mastermap data seems
to more or less work.
The work related to XSISCHEMA was really adding a mechanism for someone
creating files with GML to add a reference to a previously created schema
file. I have also added a bunch of logic to try and create a valid schema
on the fly in a .xsd file, though I am not sure whether the result is valid.
Neither of these will help much in reading OS Mastermap data.
I am not exactly sure how to proceed. Currently when OGR reads a GML file
it writes out a .gfs file which contains informaton on the schema, feature
count and extents so that subsequent reads of the file can skip the extra
"exploration" pass, and so metadata will be known from the start. My
intention was always that .gfs files could also contain various rules
for reading tricky GML files. So in this OS MasterMap case it might
contains information on how to identify features (they are children of
<osgb:cartographicMember>), or allowing renaming and typing of otherwise
untyped properties.
The other approach is to add proper schema (.xsd) reading to the OGR GML
reader. This would potentially make OGR much more robust as all the
information actually embedded in the .xsd files could be used to identify
features; however, it is very difficult.
What I have done for the time being is modify the code to treat any element
ending in "member" as potentially containing a feature. This works for the
OS MasterMap data.
I would suggest you try the latest from CVS and see if it is adequate to
your needs.
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 | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list