[gdal-dev] WFS driver, ogrinfo and GetFeature

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Dec 19 07:57:05 EST 2011


Hi,

If user wants to read a summary of a certain WFS feature type with a command like

ogrinfo -ro -so WFS:http://server.com/wfs ns:typeName 

GDAL seems to send then four separate commands:

First:
SERVICE=WFS&REQUEST=GetCapabilities&ACCEPTVERSIONS=1.1.0,1.0.0
Second:
SERVICE=WFS&VERSION=1.1.0&REQUEST=DescribeFeatureType&TYPENAME=[list of all the
typenames in the whole service]
Third:
SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=ns:typeName&RESULTTYPE=hits
Fourth:
SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=ns:typeName

Questions:
- Why to send DescribeFeatureType for all the feature types when user is only
interested in the named one "ns:typeName"? 
- Is is necessary to send the fourth request and read the whole layer from the
service? I guess it is because GDAL wants to see the real geometries so it can
calculate correct extents for the layer but it can be quite a heavy load for the
WFS server.

In fact the following line leads to an ultimate query "get everything that
exists in the WFS service"

orginfo -al -so WFS:http://server.com/wfs

This will make one by one full GetFeatures for all the feature types in the
whole service. My service has 55 feature types and many of them has more than
million features and ogrinfo will probably fail if my server won't fail earlier
with sending a few gigabytes of GML. I consider it a little bit dangerous that
users can send such requests accidentally. I think that at least users should
especially do something before GDAL would create the fourth request, the plain
GetFeature.

-Jukka Rahkonen-




More information about the gdal-dev mailing list