[Qgis-user] Short question on wfs

Richard Duivenvoorde rdmailings at duif.net
Mon Sep 7 02:02:28 PDT 2020


Yeah, 

That is one of the drawbacks of WFS: the number of versions AND the number of different implementations of the standard...

Not sure around which version (I think 1.1) but at a certain moment wisdom appeared that we say 'latlon' (yx) but we use lonlat (xy) in requests. So the default way became requesting (and returning) yx, but... some servers implemented that, others did half etc. etc. That is why the axis orientation checkboxes are there, so at least QGIS can do both..

'Paging' is in WFS since 2.0. It means that for larger datasets, the service makes is it possible to request features (in a bbox) based on a COUNT-parameter and a START(?)-parameter.
So when in a box there are 60000 features, and the service allowes only to request 10000 feature at a time, you can do that by request six 'pages':
start=0&count=10000
start=10000&count=10000
start=20000&count=10000
etcetc

This off course makes logic both on client AND serverside more difficult: what if the users zooms out, so part of the features are already loaded in QGIS/client etc etc... 
Serverside this means that you need to have your features ordered and sorted on a primary key, otherwise you cannot service the 'next' 10000 etc etc

HTH

Regards,

Richard Duivenvoorde


On 9/7/20 10:32 AM, Bernd Vogelgesang wrote:
> Hi Richard,
> 
> many thanks to have a look at it.
> 
> I finally manged to get  something some minutes ago:
> 
> First success was, to limit the output to 100 features to get at least
> something loaded.
> But: There were features only in the attribute table, but nothing on the
> map. I had to pick a feature there and then zoom to it, and found them
> near the Somalia coastline, though everhing indicated that it was using
> EPSG 25832.
> 
> After another round of scratching my head, I ticked everything in the
> setting, including invert axis orientation, and that seems to do the
> trick. Now I have features displayed and everything seems to be fine.
> 
> Assuming, that all available checkboxes in the settings reflect the
> standard in an unchecked state, this service seems to do everything the
> other way around.
> 
> Cheers,
> 
> Bernd
> 
> p.s. what does the paging option mean, and what values have to be put
> there? Can't find any explanations to this.
> 
> 
> 
> On 07.09.20 10:12, Richard Duivenvoorde wrote:
>> On 9/6/20 11:29 PM, Bernd Vogelgesang wrote:
>>> Hi folks,
>>>
>>> without any success I try to load stuff from a wfs server (long time ago
>>> that I last tried to). Although the checkbox to only load the features
>>> in the canvas extend is checked, this does not seem to have any
>>> influence. Adding the layer, nothing shows up, everything is frozen and
>>> in the end after a long time, there is a time out error.
>>> So obviously, it is attempted to load all 180000 features, and not only
>>> those within the canvas extend.
>>>
>>> Documentation also only handles stuff which is more than obvious.
>>>
>>> What is the obviously not obvious trick to load stuff from a wfs server?
>> 1) be sure it is working :-)
>> 2) what you did
>>
>> I tested in in current master, and had a look at the url's QGIS is firing
>> Using the 'Detect' button, you can see the service says it is a WFS 2.0 service, so should be able to 'page' ...
>>
>> I opened an OSM map, and zoomed in just outside of Munchen.. (that is Bayern isn't it?)
>>
>> QGIS starts with requesting the capabilities:
>>
>> https://www.baysis.bayern.de/gis/services/wfs/BAYSIS_Strassennetz/MapServer/WFSServer?SERVICE=WFS&REQUEST=GetCapabilities&VERSION=2.0.0
>>
>> Then it tries to determine the type of the features to be returned by doing a DescribeFeatureType request
>>
>> https://www.baysis.bayern.de/gis/services/wfs/BAYSIS_Strassennetz/MapServer/WFSServer?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=2.0.0&TYPENAMES=STRNETZ_WFS:Strassennetz&TYPENAME=STRNETZ_WFS:Strassennetz
>>
>> And then it requests (using a bbox!) the Strassennetz
>>
>> https://www.baysis.bayern.de/gis/services/wfs/BAYSIS_Strassennetz/MapServer/WFSServer?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=STRNETZ_WFS:Strassennetz&TYPENAME=STRNETZ_WFS:Strassennetz&SRSNAME=urn:ogc:def:crs:EPSG::3857&BBOX=1278607.34396637254394591,6140795.31043378822505474,1283062.13300827727653086,6144202.10006356053054333,urn:ogc:def:crs:EPSG::3857
>>
>> which if you replay it in a browser does not give anything back.
>>
>> Is the service picky with CRS's?
>> Which feature should be working?
>> Does the service work in other tools?
>>
>> Regards,
>>
>> Richard Duivenvoorde



More information about the Qgis-user mailing list