<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:st="&#1;" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40" xmlns:ns0="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:ns1="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:ns2="http://schemas.microsoft.com/office/2006/digsig" xmlns:ns3="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:ns4="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ns5="http://schemas.microsoft.com/office/2004/12/omml" xmlns:ns6="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:ns7="http://microsoft.com/sharepoint/webpartpages" xmlns:ns8="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns9="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:ns10="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:ns11="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:ns12="urn:schemas-microsoft-com:">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName" /><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]--><style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}
p.MSOACETATE
        {mso-style-priority:99;}
li.MSOACETATE
        {mso-style-priority:99;}
div.MSOACETATE
        {mso-style-priority:99;}
span.BALLOONTEXTCHAR
        {mso-style-priority:99;}

 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Palatino Linotype";
        panose-1:2 4 5 2 5 5 5 3 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:Tahoma;}
span.BalloonTextChar
        {font-family:Tahoma;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:Calibri;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:Calibri;
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy">Thanks for the reply, I will try that approach and see how it turns out.&nbsp; It does seem like it may be pretty taxing and slow with a lot
 of points to keep looping different circles around them (I forgot to explain there would be a lot).&nbsp; Is there anything in the API for &#8220;closest&#8221; ? Just to get the ID of the segment?&nbsp; I actually don&#8217;t need to select them. &nbsp;&nbsp;I was also going to check into SQL
 spatial to see if there is any way to do it as well.&nbsp; Thanks<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:
10.0pt;font-family:Arial;color:navy"><o:p>&nbsp;</o:p></span></font></p>
<div>
<div>
<p class="MsoNormal"><font size="2" color="navy" face="Palatino Linotype"><span style="font-size:11.0pt;font-family:&quot;Palatino Linotype&quot;;color:navy">Brian</span></font><font color="navy"><span style="color:navy">
<o:p></o:p></span></font></p>
</div>
<div>
<p class="MsoNormal"><font size="2" color="navy" face="Calibri"><span style="font-size:
11.0pt;color:navy">&nbsp;<o:p></o:p></span></font></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><font size="2" color="navy" face="Calibri"><span style="font-size:
11.0pt;color:navy">&nbsp;</span></font><o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;">
<hr size="2" width="100%" align="center" tabindex="-1">
</span></font></div>
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;
font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> mapguide-users-bounces@lists.osgeo.org
 [mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style="font-weight:
bold">On Behalf Of
</span></b>Dave Wilson<br>
<b><span style="font-weight:bold">Sent:</span></b> Wednesday, June 17, 2009 4:54 PM<br>
<b><span style="font-weight:bold">To:</span></b> <st1:PersonName w:st="on">MapGuide Users Mail List</st1:PersonName><br>
<b><span style="font-weight:bold">Subject:</span></b> [mapguide-users] RE: Spatial Query</span></font><font size="3" face="Times New Roman"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;"><o:p></o:p></span></font></p>
</div>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11.0pt;color:#1F497D">You could do a spatial query using a circle in a loop continually increasing the radius each time until you get a result. Setting the initial radius
 and the increments of the circle probably depends on the coordinate system of the data although this is similar to the logic in the selection for a click select in the AJAX Viewer so you could start with that.<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11.0pt;color:#1F497D"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11.0pt;color:#1F497D">Dave<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" color="#1f497d" face="Calibri"><span style="font-size:11.0pt;color:#1F497D"><o:p>&nbsp;</o:p></span></font></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><font size="2" face="Tahoma"><span style="font-size:10.0pt;
font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span style="font-size:10.0pt;font-family:Tahoma"> mapguide-users-bounces@lists.osgeo.org
 [mailto:mapguide-users-bounces@lists.osgeo.org] <b><span style="font-weight:
bold">On Behalf Of
</span></b>Berdel, Brian<br>
<b><span style="font-weight:bold">Sent:</span></b> Wednesday, June 17, 2009 2:17 PM<br>
<b><span style="font-weight:bold">To:</span></b> <st1:PersonName w:st="on">MapGuide Users Mail List</st1:PersonName><br>
<b><span style="font-weight:bold">Subject:</span></b> [mapguide-users] Spatial Query<o:p></o:p></span></font></p>
</div>
</div>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt">What is the best approach to performing a spatial query as such that a road segment closest to a point is selected?&nbsp; Any examples out there?&nbsp; Not sure if OpenLayers or Mapguide
 Api would be best, but appreciate any suggestions. <o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt">Thanks!<o:p></o:p></span></font></p>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></font></p>
<div>
<p class="MsoNormal"><font size="3" face="Palatino Linotype"><span style="font-size:12.0pt;font-family:&quot;Palatino Linotype&quot;">Brian
</span></font><o:p></o:p></p>
</div>
<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt;font-family:&quot;Times New Roman&quot;"><o:p>&nbsp;</o:p></span></font></p>
<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;">
<hr size="2" width="100%" align="center">
</span></font></div>
<p class="MsoNormal"><font size="1" color="gray" face="Arial"><span style="font-size:
7.5pt;font-family:Arial;color:gray">Important notice to recipients:<br>
Copies of documents that may be relied upon by you are limited to the printed copies (also known as 'hard copies') that are signed and sealed by the Engineer and/or Land Surveyor. Files in electronic formats, or other types of information furnished by the Engineer
 and/or Land Surveyor to you such as text, data or graphics are for your convenience only. Any conclusions or information obtained or derived from such electronic files will be at the user's sole risk. When transferring documents in electronic formats, the
 Engineer and/or Land Surveyor makes no representation as to long-term compatibility, usability, or readability of the documents resulting from the use of software application packages, operating systems or computer hardware differing from those used by McMahon
 Associates, Inc. at the beginning of the project.</span></font><font size="3" face="Times New Roman"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;"><o:p></o:p></span></font></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">Important notice to recipients:<br>
Copies of documents that may be relied upon by you are limited to the printed copies (also known as 'hard copies') that are signed and sealed by the Engineer and/or Land Surveyor. Files in electronic formats, or other types of information furnished by the Engineer
 and/or Land Surveyor to you such as text, data or graphics are for your convenience only. Any conclusions or information obtained or derived from such electronic files will be at the user's sole risk. When transferring documents in electronic formats, the
 Engineer and/or Land Surveyor makes no representation as to long-term compatibility, usability, or readability of the documents resulting from the use of software application packages, operating systems or computer hardware differing from those used by McMahon
 Associates, Inc. at the beginning of the project.<br>
</font>
</body>
</html>