I'm using getGetFeatureInfoUrl to retrieve features from a WMS layer. Tolerance is a server side parameter, QGIS server offers optional parameters to define the tolerance for point, line and polygon layers so I make this request:

var url = wmsSource.getGetFeatureInfoUrl(
    coordinates, viewResolution, viewProjection,
        'INFO_FORMAT': 'text/xml', 
        'FEATURE_COUNT': 100,
        'FI_LINE_TOLERANCE': 0,
        'FI_POINT_TOLERANCE': 0,

The problem is that adding the tolerance parameters to the request doesn't make any change, the URL given back by Openlayers always contains the same extent and so involves a lot of neighbor features which shouldn't be included.

Is there any configuration to do on QGIS side or what else could happen that this parameters don't show any effect?

  • So you know that the server at mapa.psig.es is QGIS server? Other servers for sure just skip the QGIS specifec vendor parameters. If you believe that these parameters should change the BBOX you are wrong, Only thing that should happen is to include the extra parameters in the request and that seems to happen correctly &FI_LINE_TOLERANCE=0&FI_POINT_TOLERANCE=0&FI_POLYGON_TOLERANCE=0. Increasing values to 1000000 does not make change so it feels like you are right and that server does not support those parameters. – user30184 Mar 28 '18 at 14:45
  • I also do manage the server side, so yes, I know for sure that it's QGIS server. But who then defines the extent of BBOX, is it Openlayers or the map server? Manually testing with a smaller BBOX I get the expected result, but how can I change this extent? – geraldo Mar 28 '18 at 15:27
  • 1
    The BBOX is the same that was used for getting the map. Read chapter 7.4 of the WMS standard for seeing the details. portal.opengeospatial.org/files/?artifact_id=14416. If QGIS vendor parameters do not work at certain scales it may be a QGIS bug. – user30184 Mar 28 '18 at 15:32
  • Thanks for the clarification. So actually the coordinates parameter passed to GetFeatureInfo request gets converted to the i/j coordinates parameter in the WMS request, and not the bounding box as I thought. For the issue of tolerance parameters getting ignored by map server, I'll look for help at QGIS mailing lists. – geraldo Mar 28 '18 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.