[gdal-dev] GML / NAS code redundancy

Even Rouault even.rouault at mines-paris.org
Tue Mar 18 09:25:13 PDT 2014


Selon Martin Landa <landa.martin at gmail.com>:

> Hi,
>
> 2014-03-18 16:35 GMT+01:00 Even Rouault <even.rouault at mines-paris.org>:
> > some categories of application schemas easier. See the "Registry for GML
> > application schemas" paragraph of http://gdal.org/ogr/drv_gml.html. Perhaps
> your
> > use case could fit into that.
>
> right, after digging into the code I discovered that `featureType`
> from `gml_registry.xml` is checked only in header (first 2048 bytes)
> [1]. This check fails in my case because features are not included in
> szHeader buffer. Could be that I overlooked something...

Ah, well all of this is heuristics, so you could likely increase the buffer size
if it remains at reasonable size.

Another idea, if the patterns to recognize are much further in the file, since
at that point we know that it is GML, would be to separate the recognition of
whether it is GML or not (that has succeeded since you reached that point) from
the recognition of what stuff there is in the GML, in which case you could
afford to read more. But namespaces declaration are usually rather at the
beginning of the file, so if 2048 doesn't work, perhaps 4096 would do.


>
> Martin
>
> [1]
>
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/gml/ogrgmldatasource.cpp#L771
>




More information about the gdal-dev mailing list