[gdal-dev] Re: WFS driver, ogrinfo and GetFeature

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Dec 19 09:32:46 EST 2011


Even Rouault <even.rouault <at> mines-paris.org> writes:

....
> > 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.
> 
> Not much can be done : there's no way to make interact the user with 
> the driver and ogrinfo doesn't know which requests are expensive 
> or not. Perhaps one could have a cheaper implementation of 
> GetExtent() based on what is in the GetCapabilities response. 
> But AFAIR, you only get the bounding box in latitude/longitude,
> even if the default SRS is something else. One could try to
> reproject the lat/long bounding box into the target SRS, but that 
> might be inaccurate in some cases, not to say plainly wrong (consider
> UTM zone 60, polar projections, etc...). Even in the case where the 
> SRS is EPSG:4326, I've avoided to use the advertized bounding box 
> because of uncertainty about what the coordinate order should be, 
> and how WFS servers have understood or misunderstood
> the spec (see ticket http://trac.osgeo.org/gdal/ticket/4041 for 
> more details).
> 
> In the meantime, you could just comment the line in ogrinfo that calls
> GetExtent().

I am thinking as a WFS server admin and I cannot comment out the line 
from those who are possibly using our services with GDAL. I am  not 
causing so much trouble for myself :) 

I have set maxFeatures to 100000 on the server side. It will mean that the
accurate extents method of gdal will calculate them for the first 100000
features and with our layers which are spatially ordered the result will 
be much more wrong than if using and reprojecting the advertised extents.

I would say that if WFS 1.1.0 server is answering for the first 
resulttype=hits query that there are 100000 features to come then ogrinfo 
should be able to know that it could be expensive to get them all with 
the next resulttype=features request. 

I have been thinking that WFS developers should never test anything 
against WFS feature types containing less than one million polygons. 
Testing against World boundaries does not show the whole picture.

-Jukka Rahkonen-




More information about the gdal-dev mailing list