<div dir="ltr">Thanks Mathias!<div>I will investigate it. Maybe an heuristic for the tolerance could be used on the base of the BBOX coordinates...</div><div><br></div><div>giovanni</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-17 15:39 GMT+02:00 Mathias Walker <span dir="ltr"><<a href="mailto:mwa@sourcepole.ch" target="_blank">mwa@sourcepole.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'Ubuntu';font-size:9pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Hi Giovanni</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">QGIS Server uses a fixed percentage (1 or 2%) of the image size as a default tolerance for GetFeatureInfo requests. This works nicely with a full sized image e.g. in the QGIS WebClient. But with the smaller image size in the OL3 GetFeatureInfo request this results in a single pixel tolerance which requires pixel perfect clicks.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">There are new parameters in QGIS Server to set the tolerance in GetFeatureInfo requests (should be available from QGIS 2.10):</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   FI_POINT_TOLERANCE</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   FI_LINE_TOLERANCE</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">   FI_POLYGON_TOLERANCE</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">The tolerances can be set in pixels per geometry type.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">If you add these parameters to your OL3 getGetFeatureInfoUrl() calls, the feature info requests should respond to less precise clicks.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Cheers</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Mathias</p><div><div class="h5">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Am Donnerstag, 17. September 2015, 12.07:32 schrieb G. Allegri:<br></p>
<p style="margin-top:12px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">OL3 has changed the way GetFeatureInfo request parameters are generated.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">The nre way uses fixed WIDTH/HEIGHT and X/Y (I/J) params: 101 for the first and 50 latters. Then it builds the BBOX parameter consequently.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">The old way they were built from the size and extent of the map, and the query coordinate.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">The new style makes QGIS Server respond with empty results if the click is not exactly on the feature coordinates. </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">I've tested the same request on the same layer served by Geoserver, which responds even with not so precise clicks.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">Can this be caused by coordinates rounding happening inside QGIS Server?</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">giovanni<br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">-- <br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">Giovanni Allegri<br><a href="http://about.me/giovanniallegri" target="_blank"><span style="text-decoration:underline;color:#0057ae">http://about.me/giovanniallegri</span></a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">Gis3W - <a href="http://gis3w.it" target="_blank"><span style="text-decoration:underline;color:#0057ae">http://gis3w.it</span></a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">Ikare - <a href="http://ikare.it" target="_blank"><span style="text-decoration:underline;color:#0057ae">http://ikare.it</span></a><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">Twitter: <a href="https://twitter.com/_giohappy_" target="_blank"><span style="text-decoration:underline;color:#0057ae">https://twitter.com/_giohappy_</span></a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px">blog: <a href="http://blog.spaziogis.it" target="_blank"><span style="text-decoration:underline;color:#0057ae">http://blog.spaziogis.it</span></a><br>GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank"><span style="text-decoration:underline;color:#0057ae">http://bit.ly/GEOplus</span></a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br><br></p>
</div></div><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">-- </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Sourcepole - Linux & Open Source Solutions</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Weberstrasse 5, 8004 Zürich, Switzerland</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Tel: 044 440 77 11  Direkt: 044 515 67 71</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">mwa at <a href="http://sourcepole.ch" target="_blank">sourcepole.ch</a>  <a href="http://www.sourcepole.ch" target="_blank">http://www.sourcepole.ch</a></p></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Giovanni Allegri<br><a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a></div><div dir="ltr">Gis3W - <a href="http://gis3w.it" target="_blank">http://gis3w.it</a></div><div dir="ltr">Ikare - <a href="http://ikare.it" target="_blank">http://ikare.it</a><br><div>Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a></div><div>blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a></div></div></div></div></div>
</div>