<div>Steve,</div>
<div>&nbsp;</div>
<div>Thank you for the explanation.</div>
<div>I speed up my&nbsp;queries removing from the layer the features without information and using MS_SINGLE, because I just need&nbsp;the closest feature.</div>
<div>Another question if you have time.</div>
<div>querybypoint is faster than querybyrect?</div>
<div>&nbsp;</div>
<div>Thanks again,</div>
<div>&nbsp;</div>
<div>Fred<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 5/18/06, <b class="gmail_sendername">Steve Lime</b> &lt;<a href="mailto:Steve.Lime@dnr.state.mn.us">Steve.Lime@dnr.state.mn.us</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Layer tolerances are used to set a spatial filter that is used to identify target<br>features. Those features are then processed to make sure they meet the
<br>target criterea. For example, if you query a layer with a tolerance of 100 meters<br>then MapServer constructs a bbox 200 meters on a side centered on the<br>query point and uses that to find candidate features.<br><br>
There is no predictable relationship between tolerance and query speed although<br>in practice smaller tolerances should produce faster queries since there are likely<br>to be less candidate features to process.<br><br>MS_SINGLE will find the closest feature in a point query situation (potentially
<br>across multiple layers). MS_MULTIPLE will find all features that meet the tolerance<br>settings. MS_SINGLE can be much faster in certain situations, especially when<br>querying a polygon layer since being inside the polygon gives you a distance
<br>of 0 and stops the query process. When querying points and lines where a<br>perfect 0 distance is unlikely you end up having to process all candidate features<br>to make sure you identify the closest one.<br><br>Querybyrect is faster than querybyshape.
<br><br>Steve<br><br>&gt;&gt;&gt; Frederico Lucca &lt;<a href="mailto:fredlucca@GMAIL.COM">fredlucca@GMAIL.COM</a>&gt; 5/18/2006 8:40:05 AM &gt;&gt;&gt;<br>Hello list,<br><br>I'm querying a layer by point, using tolerance in meters because I need to
<br>find some street in a point using Decimal Degrees and a range in meters.<br><br>Something like:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer.setSizeunits(mapscript.MS_METERS);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer.setToleranceunits(mapscript.MS_METERS);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
layer.setTolerance(radius);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; layer.queryByPoint(map, point, mapscript.MS_SINGLE, -1)<br><br>Comparing two radius, 100 and 50 meters, I think 50 is twice faster than<br>100, is this true?<br><br>What's the difference between MS_SINGLE and MS_MULTIPLE.
<br>MS_SINGLE find one, and only one feature??? MS_SINGLE is much faster than<br>MS_MULTIPLE?<br>Supousing that I need to return the nearest street name and some streets<br>don't have name, is better to querybypoint with 50 meters and if the street
<br>don't have a name find again, with 100 meters? Or find MS_MULTIPLE with 100<br>meters?<br>querybyrect or querybyshape are faster?<br><br>I need the fastest result because i need to query in 10 layers very quickly.<br>
<br>Thanks in advance.<br><br>Fred<br><br>--<br>&quot;Everything under the sun is in tune<br>But the sun is eclipsed by the moon&quot;<br></blockquote></div><br><br clear="all"><br>-- <br>&quot;Everything under the sun is in tune
<br>But the sun is eclipsed by the moon&quot;