[Qgis-user] FW: Inconsistent WFS layer requests

Thomas Colley it087 at neath-porttalbot.gov.uk
Wed Mar 9 08:07:34 PST 2016


Thanks for the explanation Even, the maxfeatures=1 request makes sense now.

There's a GetCapabilities request issued after the DescribeFeatureType and maxfeatures=1 requests that includes the bbox and typename parameters, so it looks as though that should be the GetFeature request?

Panning/zooming the layer does not fire off any further requests but hitting the refresh button does trigger a new, correct GetFeature request which returns all the features as expected.

It's great to hear that there's work on-going with the WFS provider, hopefully this info is of some use to you. Below is the URL you can use to test the service that is causing problems. It is valid for a month from today but if you need it after that I can make it available for longer.

http://www.getmapping.com/web.feature.service/FeatureService.svc/qgistest/t35tacc0unt/OSMeridian2?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=SETTLEMT_POINT&SRSNAME=EPSG:27700&BBOX=260202.45311197891714983,180424.54472032448393293,277756.54401441267691553,204770.92205234317225404

Thanks for your help with this

Tom

-----Original Message-----
From: Even Rouault [mailto:even.rouault at spatialys.com] 
Sent: 09 March 2016 15:27
To: qgis-user at lists.osgeo.org
Cc: Thomas Colley
Subject: Re: [Qgis-user] FW: Inconsistent WFS layer requests

Le mercredi 09 mars 2016 09:22:57, Thomas Colley a écrit :
> Hi
> 
> I mistakenly posted this to developer list instead of user yesterday, 
> hope it's ok to post here too.
> 
> I am trying to troubleshoot a problem we're having with a WFS service 
> in QGIS 2.14. I am loading in a layer with 'Only request features 
> overlapping the current view extent' and have tried cached and 
> uncached. The layer loads only 1 feature and that is not within the 
> map canvas. I have used Wireshark to capture the requests and can see 
> that QGIS is making the GetFeature request with no bbox parameter and 
> a maxfeatures parameter set to 1.
> 
> In QGIS 2.12.2 the GetFeature request with no bbox and maxfeatures=1 
> is still made but then it is followed up with another GetFeature 
> request with the correct bbox and all features are loaded onto the 
> layer as expected. I am wondering if the maxfeatures=1 request is a 
> probe to test that valid features are being returned before making the 
> proper request but in 2.14 the proper request never gets sent. Looking 
> at the layer metadata in QGIS the layer source shows the correct request URL.
> 
> It's confusing as we have other WFS services which are working fine in 
> 2.14. If I can narrow the issue down to being a problem with the 
> service itself I can approach the supplier.

The request with maxfeatures=1 is done when the response to the DescribeFeatureType request couldn't determine if the geometry type is point, line or polygon. So it downloads a single feature and use its geometry type as the layer type.

So I guess there's a logic problem in the code in that probably rarely used code path.

Did you try doing a zoom in or zoom out or pan operation ? This might perhaps help triggering a new request (not sure though)

> 
> It's a commercial WFS but if anyone is able to test I can provide the 
> connection URL.

I'm currently doing a major overhaul of the WFS provider (
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/53 ) . That would be good if I could test your use case at some point. But not before a few weeks as the code isn't ready yet.

> 
> Below are details of the packets being sent from QGIS.
> 
> Thanks very much
> 
> Tom
> 
> WFS connection string:
> http://www.getmapping.com/web.feature.service/FeatureService.svc/xxxx/xxxxx
> /mastermap?
> 
> Layer source from Layer Properties > Metadata tab > Properties
> http://www.getmapping.com/web.feature.service/FeatureService.svc/xxxx/xxxxx
> /mastermap?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=topographi
> carea&SRSNAME=EPSG:27700&BBOX=274257.18611745559610426,195451.6365115281660
> 1098,274325.73425826861057431,195546.70830481656594202
> 
> Requests sent when adding WFS layer (caught by Wireshark):
> http://www.getmapping.com/web.feature.service/FeatureService.svc/xxxx/xxxxx
> /mastermap?SERVICE=WFS&VERSION=1.0.0&TYPENAME=topographicarea&BBOX=274257.1
> 8611745559610426,195451.63651152816601098,274325.73425826861057431,195546.7
> 0830481656594202&REQUEST=DescribeFeatureType
> 
> http://www.getmapping.com/web.feature.service/FeatureService.svc/xxxx/xxxxx
> /mastermap?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=topographi
> carea&SRSNAME=EPSG:27700&&MAXFEATURES=1
> 
> http://www.getmapping.com/web.feature.service/FeatureService.svc/xxxx/xxxxx
> /mastermap?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&TYPENAME=topog
> raphicarea&SRSNAME=EPSG:27700&BBOX=274257.18611745559610426,195451.63651152
> 816601098,274325.73425826861057431,195546.70830481656594202

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


More information about the Qgis-user mailing list