[gdal-dev] Namespaces in GMLAS

Even Rouault even.rouault at spatialys.com
Mon Oct 16 03:25:26 PDT 2017


On lundi 16 octobre 2017 13:03:32 CEST Ari Jolma wrote:
> Thanks,
> 
> After fixing srsName attribute in the returned gml (the HTTP errors i
> mention below) I can now read the features in the file (GetNextFeature
> on the dataset object).
> 
> As a second step I try to make the download implicit (assuming the
> srsName would be ok) and use the /vsicurl mechanism, i.e., open
> 
> /vsicurl/https://opaskartta.turku.fi/TeklaOGCWeb/WFS.ashx?request=GetFeature
> &typename=akaava:Suojelualue
> 
> directly.

You can use GMLAS:/vsicurl/...

The following works for me:
ogrinfo "GMLAS:/vsicurl/https://opaskartta.turku.fi/TeklaOGCWeb/WFS.ashx?request=GetFeature&typename=akaava:Suojelualue&version=1.1.0" 

Not however that for a large file (> 16 MB), /vsicurl/ will not manage to cache the whole file. As the GMLAS driver requires multiple parsing passes,
this will cause the document to be re-downloaded several times. 
You can workaround that by setting VSI_CACHE=YES and increasing the  VSI_CACHE_SIZE value. Or downloading it entirely in a local file.

Hum, actually for such files, /vsicurl/ will probably not work since it issues GET range requests that WFS servers are unlikely to honour.
/vsicurl_streaming/ should be used, as it does a standard HTTP GET request, and reading XML file is purely a sequential operation that doesn't require random seeking.

> 
> That seems difficult (impossible?) since GMLAS driver expects the name
> to start with GMLAS prefix. I don't see any obvious way to go around
> that. I can force GDAL to try only GMLAS but that does not help. Would
> it be possible to make OGRGMLASDriverIdentify return true using some option?

The Identify() method could potentially look at poOpenInfo->papszAllowedDrivers, and if
it is made of a single entry that is GMLAS, it could remove the requirement for the GMLAS: prefix
There would be probably a few other changes since some code must expect the GMLAS: prefix

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list