[GIS] Error: “Layer is not valid” when adding a WFS layer in QGIS

qgiswfs

Tried at both QGIS 2.16.3 and 2.18.8. Running on Windows 10 64bit.

Dutch government offers a particular WMS/WFS service. The WMS link works fine

I can also connect to a WFS link:

https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF/wfs?

But then I get an error:

Layer is not valid: The layer retrictToRequestBBOX='1'
srsname='EPSG:28992'
typename='MBIZ4280LEEF_public:referentiekaart_grid_100m'
url='https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF/wfs?'
version='auto' table="" sql= is not a valid layer and can not be added
to the map

Turning OTF on/off at project properties doesn't make a difference.
I was able to load in other WFS-layers from other Dutch government links, like the BAG.

Any ideas?

Best Answer

It seems that QGIS is unable to download the feature type description. At first I thought this was because the server says these requests should be to

<ows:Operation name="DescribeFeatureType">
<ows:DCP>
<ows:HTTP>
<ows:Get xlink:href="https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF_public/wfs"/>
<ows:Post xlink:href="https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF_public/wfs"/>
</ows:HTTP>
</ows:DCP>

But QGIS is using:

https://services.geodan.nl/public/data/org/gws/MBIZ4280LEEF/MBIZ4280LEEF/wfs?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=1.1.0&TYPENAME=MBIZ4280LEEF_public:referentiekaart_buurten

which is a bug.

But even requests to the correct URL give Access Denied, which leads me to think there is probably some sort of access key required? But I don't speak enough Dutch to investigate further. I think you need to speak to the contact person (possibly by snail mail):

<ows:ServiceProvider>
<ows:ProviderName>Ministerie van BZK</ows:ProviderName>
<ows:ServiceContact>
<ows:IndividualName>Postbus Leefbaarometer</ows:IndividualName>
<ows:PositionName>directie Kennis en Verkenningen</ows:PositionName>
<ows:ContactInfo>
<ows:Phone>
<ows:Voice>None</ows:Voice>
<ows:Facsimile>None</ows:Facsimile>
</ows:Phone>
<ows:Address>
<ows:DeliveryPoint/>
<ows:City>Den Haag</ows:City>
<ows:AdministrativeArea>Zuid-Holland</ows:AdministrativeArea>
<ows:PostalCode>2511 DP</ows:PostalCode>
<ows:Country>Nederland</ows:Country>
<ows:ElectronicMailAddress/>
</ows:Address>
</ows:ContactInfo>
</ows:ServiceContact>
</ows:ServiceProvider>
Related Question