[mapserver-users] mapscript queryByPoint - tolerancedepends ofresolution ?

Oliver Christen oliver.christen at camptocamp.com
Tue Jul 15 08:27:00 EDT 2008


Hi

The problem was not in mapserver but came from our script:
when the dpi is changed, the tolerance is globaly adjusted so all the 
related features dont get over/undersized.

But when a value of -1 is used in queryByPoint, the global tolerance 
recalculated result in -3.25~ when passing from 96 to 150 dpi
and mapserver do not know what to do with such value, it only understand -1 
or >=0.

The problem was solved by specifying a special case when -1 was used in our 
script for queryByPoint, so the tolerance stay at -1 at 96 and 150 dpi

Could you possible modify a bit the mapscript documentation of  queryByPoint 
?
It say "Passing buffer <=0 defaults to tolerances set in the map file ..." 
but thats not exactly the case.
It would be "Passing buffer -1 defaults to tolerances set in the map 
file..."

Thank you
Best regards
Oliver

----- Original Message ----- 
From: "Steve Lime" <Steve.Lime at dnr.state.mn.us>
To: "Oliver Christen" <oliver.christen at camptocamp.com>; 
<mapserver-users at lists.osgeo.org>
Sent: Wednesday, July 09, 2008 6:39 PM
Subject: Re: [mapserver-users] mapscript queryByPoint - tolerancedepends 
ofresolution ?


Tolerance computations are based on cellsize. Resolution affects only scale 
computations, so it
is not clear to me how one could affect the other. I just went through the 
code to verify. Is there
any chance that layer scale limits are coming into play here and you're not 
querying the layer you
think you are? Does the behavior persist in 5.x?

If you can create a concise test case I'll gladly take a look.

Steve

>>> On 7/9/2008 at 7:41 AM, in message 
>>> <2A7451FF53BE4CF0BC85B033346C7A94 at maunakea>,
"Oliver Christen" <oliver.christen at camptocamp.com> wrote:
> Hi
>
> I have a problem when doing a queryByPoint with phpmapscript 4.10.1
>
> By default, the resolution of my map is 96 dpi.
> I do a queryByPoint on a layer containing polygonal areas. The point is
> right in the middle of one area.
> I use a default tolerance (-1) corresponding, if I read correctly the
> documentation, to 3 pixels.
>
> The result obtained is the area containing the coordinates I used, it's
> absolutly normal and I get what I expect.
>
> Now, if I dynamicaly change the resolution of the map to 150 dpi and then 
> do
>
> exactly the same queryByPoint as before,
> I get nothing!
> Mapserver consider there was nothing at the coordinate I provided.
>
> Then, if I redo the query, at 150 dpi, BUT with a tolerance set to 10
> (instead of -1), I get a correct and expected result.
>
> So, somehow, Mapserver seems to make some very weird calculation with the
> tolerance and resolution which make it to believe there is nothing when 
> then
>
> is something.
>
> have you ever heard of such behaviour?
> is that a bug?
>
> any help would be very welcome.
>
> thanks in advance
> Oliver
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list