<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16735" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#000000 size=2>Dear List, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm updating a spatial querying tool that follows a process something like:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>1. Select set of shapes from layer A with <EM>n</EM>&nbsp; results: A[1-n]</FONT></DIV>
<DIV><FONT face=Arial size=2>2. Find shapes from layer B that within buffer&nbsp;distance D of selected shapes from A[1-n]</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In the existing code we get a result set of A[1-n], loop through the shapes and run the buffer query on B.&nbsp; Our result is then something like sum(BUFFER(Ai, B)) for i= 1..n. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The same tool also supports other spatial queries...CONTAINS, INTERSECTS, etc...all with the same general process flow. The tool is PHP mapscript. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Questions:&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>1. Is there a better approach?</FONT></DIV>
<DIV><FONT face=Arial size=2>2. Can I get a Min Bounding Rectangle of A[1-n] to pre-filter B?&nbsp; Would that help?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks, </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Josh</FONT></DIV></BODY></HTML>