<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
Sorry but I just noticed that I made an error in my post. What I meant to say was the SW corner of PA and in the table the distance to PA should be 0 because the Point is in PA.<div><br></div><div>Thanks,</div><div>Doug</div><div><br><div><div>On Sep 9, 2008, at 8:52 AM, Doug Fischer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><p style="margin: 0.0px 0.0px 12.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">I am new to GIS / PostGIS so please forgive me if this is a simple question.</font></p><p style="margin: 0.0px 0.0px 12.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Assuming that I have a database populated with all of the proper data, I need to do determine a list of the closest borders from a point including distances.</font></p><p style="margin: 0.0px 0.0px 12.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">ex. <br> If I have a point located in the SE corner of PA, I would like to run a query that will return a list containing something like the following:</font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div> <table cellspacing="0" cellpadding="0" style="border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 2.0px 0.0px 2.0px 0.0px"> <tbody> <tr> <td valign="middle" style="width: 40.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: center; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><b>Border</b></font></div> </td> <td valign="middle" style="width: 98.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; text-align: center; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><b>Distance in miles</b></font></div> </td> </tr> <tr> <td valign="middle" style="width: 40.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">PA</font></div> </td> <td valign="middle" style="width: 98.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">A</font></div> </td> </tr> <tr> <td valign="middle" style="width: 40.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">OH</font></div> </td> <td valign="middle" style="width: 98.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">B</font></div> </td> </tr> <tr> <td valign="middle" style="width: 40.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">MD</font></div> </td> <td valign="middle" style="width: 98.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">C</font></div> </td> </tr> <tr> <td valign="middle" style="width: 40.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">WV</font></div> </td> <td valign="middle" style="width: 98.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">D</font></div> </td> </tr> <tr> <td valign="middle" style="width: 40.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">VA</font></div> </td> <td valign="middle" style="width: 98.0px; margin: 0.5px 0.5px 0.5px 0.5px; border-style: solid; border-width: 1.0px 1.0px 1.0px 1.0px; border-color: #808080 #808080 #808080 #808080; padding: 0.0px 2.0px 0.0px 2.0px"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">E</font></div> </td> </tr> </tbody> </table><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><p style="margin: 0.0px 0.0px 12.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Is there a function in PostGIS that can do this type of thing? Does anyone have an example?</font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Thank you very much. </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">postgis-users mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a></div> </blockquote></div><br></div></body></html>