Bug report #19511

WFS-Layer does not send viewparams-Parameter

Added by Stefan Overkamp over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WFS
Affected QGIS version:3.2.1 Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27339

Description

I defined a sql-view in Geoserver accepting a parameter viewparams

see: http://docs.geoserver.org/latest/en/user/data/database/sqlview.html

With the following URL I can get some features belonging to some bike route:
https://geodaten.metropoleruhr.de/geoserver/radroutenspeicher/ows?service=WFS&version=2.0.0&request=GetFeature&sortby=id&typename=radroutenspeicher:routen_netz&srs=EPSG:25832&viewparams=list:10

Loading the Layer with this source in QGIS 2.18 I can see that the viewparams (and sortby) parameter is sent to geoserver:

Request: getFeature
service = WFS
version = 2.0.0
baseUrl = https://geodaten.metropoleruhr.de:443/geoserver/
count = 1000000
outputFormat = application/gml+xml; version=3.2
resolve = none
resolveDepth = *
resolveTimeout = 300
resultType = results
startIndex = 0
viewParams0 = {LIST=10}
abstractQueryExpressionGroup0 = wfs:abstractQueryExpression=net.opengis.wfs20.impl.QueryTypeImpl@cf4ff16 (handle: null) (abstractProjectionClause: null, abstractSelectionClause: null, abstractSortingClause: [SortByImpl [propertyName=id, sortOrder=SortOrder[ASCENDING]]], aliases: null, typeNames: [{radroutenspeicher}routen_netz]) (featureVersion: null, srsName: urn:ogc:def:crs:EPSG::25832, filter: null, propertyNames: null, sortBy: null)
abstractQueryExpression0:
abstractSortingClause0 = SortByImpl [propertyName=id, sortOrder=SortOrder[ASCENDING]]
typeNames0 = {radroutenspeicher}routen_netz
srsName = urn:ogc:def:crs:EPSG::25832
sortBy0 = SortByImpl [propertyName=id, sortOrder=SortOrder[ASCENDING]]

with QGIS 3.2.1 viewParams (and sortby) is not sent:

Request: getFeature
service = WFS
version = 2.0.0
baseUrl = https://geodaten.metropoleruhr.de:443/geoserver/
count = 1000000
outputFormat = application/gml+xml; version=3.2
resolve = none
resolveDepth = *
resolveTimeout = 300
resultType = results
startIndex = 0
abstractQueryExpressionGroup0 = wfs:abstractQueryExpression=net.opengis.wfs20.impl.QueryTypeImpl@2493a0e7 (handle: null) (abstractProjectionClause: null, abstractSelectionClause: null, abstractSortingClause: null, aliases: null, typeNames: [{radroutenspeicher}routen_netz]) (featureVersion: null, srsName: urn:ogc:def:crs:EPSG::25832, filter: null, propertyNames: null, sortBy: null)
abstractQueryExpression0:
typeNames0 = {radroutenspeicher}routen_netz
srsName = urn:ogc:def:crs:EPSG::25832

Is there any whitelist of accepted parameters involved in QGIS3?

History

#1 Updated by Stefan Overkamp over 6 years ago

  • Status changed from Open to Closed

As workaround I could define a Filter on the WFS layer (SELECT * FROM routen_view WHERE route = 10).
The filter expression is passed from QGIS3 to Geoserver as filter = [ route = 10 ]:

Request: getFeature
service = WFS
version = 1.1.0
baseUrl = https://geodaten.metropoleruhr.de:443/geoserver/
query0:
filter = [ route = 10 ]
srsName = urn:ogc:def:crs:EPSG::25832
typeName0 = {radroutenspeicher}routen_view
outputFormat = text/xml; subtype=gml/3.1.1
resultType = results

Also available in: Atom PDF