queryByPoint tolerance problems

Steve Lime Steve.Lime at DNR.STATE.MN.US
Thu Dec 14 19:24:04 EST 2006


Since the pixel based computations are based on extent and image size it's
tough to tell what might be going on without seeing the script and knowing
how you debugged it. For example, how did you know features were 50
pixels away? And so on...

Steve

>>> Pēteris Brūns <peteris.bruns at GMAIL.COM> 12/14/06 8:37 AM >>>
Hi,

I have some php-mapscript based webpage, that uses layer->queryByPoint.
In map file I have set
Tolerance 10
Toleranceunits pixels

When I issue query using layer->queryByPoint with buffer==0, according 
to docs
"Passing buffer <=0 defaults to tolerances set in the map file  (in
pixels) but you can use a constant buffer (specified in ground units)
instead." 
(http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/classes/layerobj) 

it should find only objects within 10 pix.
In reality it was returning more distant objects than 10px. When I was
zoomed-in (had not default extent from mapfile), it returned results
also for 50px and more distant objects.

My Question: Is it a bug in MapServer 4.10.0 or bug in documentation?

I have already fixed my problem by calculating pixel size with PHP and
then passing search buffer size in ground units, but I still want to
know what I did wrong in first place. (Yes, I checked
$layer->tolerance and $layer->toleranceuinits and they where correct)



More information about the mapserver-users mailing list