Fwd: [gdal-dev] Can OGR WFS driver take advantage of WFS Server streaming?

Even Rouault even.rouault at mines-paris.org
Thu May 17 15:26:10 EDT 2012


> 
> How can I do below through GDAL Python API?
> 
> wget -O - "http://testing.deegree.org/deegree-
> wfs/services?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=app:Spri
> ngs"
> 
> | ogrinfo -ro -al -q /vsistdin/
> 

Well, let's say that you have the following python script 
(read_streamed_gml.py) :

from osgeo import ogr
ds = ogr.Open('/vsistdin/')
lyr = ds.GetLayer(0)
feat = lyr.GetNextFeature()
while feat is not None:
    feat.DumpReadable()
    feat = lyr.GetNextFeature()

Then you can pipe the output of wget to it that way :

wget -O - "http://testing.deegree.org/deegree-
wfs/services?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=app:Springs" 
| python read_streamed_gml.py

I'm starting to work to a /vsicurl_stream/ implementation that should avoid 
using the standard input and external wget/curl.


More information about the gdal-dev mailing list