[gdal-dev] Reading gml with schema

Pekka Sarkola pekka.sarkola at gispo.fi
Thu May 30 03:01:04 PDT 2013


Hi Folks,

Ari: thanks to raise my head. I'm now member of (also) this mailing list.

Yes, it seems that NLSFI has very unique way to create those GML's. However I have understood that they like pretty much follow INSPIRE guidelines. So, this kind of GML's could be common in Europe, soon.

I think there will few possibilities:
- Ask NLSFI to change their GML specs more like OGC GML simple features.
- Create NLSFI specific drivers for GDAL
- Develop GDAL's driver format to better support "non-simple-features" GML/XML.
- Make best practices how to use XSLT to convert "non-simple-features" GML to "simple features" GML
- something else...

Rgs,

Pekka

---   Pekka Sarkola  -  pekka.sarkola at gispo.fi  -  www.paikkatieto.com   ---


-----Alkuperäinen viesti-----
Lähettäjä: Even Rouault [mailto:even.rouault at mines-paris.org] 
Lähetetty: 29. toukokuuta 2013 17:56
Vastaanottaja: Ari Jolma
Kopio: Lauri Kajan; gdal-dev at lists.osgeo.org; pekka at gispo.fi
Aihe: Re: [gdal-dev] Reading gml with schema

Le mercredi 29 mai 2013 16:33:49, Ari Jolma a écrit :
> On 05/29/2013 05:00 PM, Even Rouault wrote:
> >> Again, being unexperienced
> >> with XSLT, I'm not sure but hope that XSLT processors run in 
> >> sequential mode, thus the reading could be conveniently handled 
> >> with a pipe. Hmm, how would that actually work, I'm not sure(?).
> > 
> > I made a quick serach but I couldn't find a definitive answer on 
> > whether XSLT processors can operate with a SAX parser, and not only on a DOM.
> 
> I meant also how would it work with GDAL. How to organize the piping?
> For example with ogrinfo:
> 
> mkfifo x
> cat maastotieto.gml | xslt > x
> ogrinfo x
> 
> Would this work?

Well, the situation is a bit complicated and needs some explanation. The GML driver needs to know the schema of the data, in a broad sense. The schema can be of course the .xsd, provided that the OGR GML XSD parser can understand it (see previous emails). If there's no .xsd or if it cannot be understood, the GML driver will make a full analysis of the file to deduce automatically a schema that will be written in a .gfs file. When the .xsd or .gfs file are generated, the driver is able to parse the GML in a streaming mode.

So, the above would (likely, I have not tested) work if a x.gfs file already exists. As all files conforming to the Maastotiedot.xsd have the same structure, you could likely use a .gfs generated for one of them for the other ones (caution: this file must have all the possible classes so they are recorded in the .gfs)

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html



More information about the gdal-dev mailing list