<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
 <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
 </head>
 <body>
  <p style="margin: 0;">
   <span>Hi</span>
  </p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">
   <span>
    <span>I'm creating a web page where the user enters a point (Longitude & Latitude) and a distance in KM (Either 0 - 5)</span>
   </span>
  </p>
  <p style="margin: 0;">I need to return from the Postgis Database all the polygone(s) within the set distanance of seid point. and return attributs from another table</p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">so this is kind of what i've come up with</p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">select a.coll_a,a,coll_b,p.coll_a from attributes a,polys p where a.coll_a = p.coll_a and ST_DWithin(p.the_geom, ST_GeomFromText('POINT(MyPoint)'4326), D) </p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">
   where MyPoint is the
   <span>
    <span>Longitude & Latitude entered and D the distance * 1000</span>
   </span>
  </p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">
   <span>
    <span>
     A will this work?
     <br/>
    </span>
   </span>
  </p>
  <p style="margin: 0;">
   <span>
    <span>is there a simpler way?</span>
   </span>
  </p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">
   <span>
    <span>btw the polygone SRID is also 4326 (WGS84)</span>
   </span>
  </p>
  <p style="margin: 0;"> </p>
  <p style="margin: 0;">
   <span>
    <span>
     Thanx
     <br/>
    </span>
   </span>
  </p>
  <p style="margin: 0px;"> </p>
  <p style="font-family: monospace; white-space: nowrap; margin: 5px 0px 5px 0px;">
   Tony
   <br/>
   <br/>
   The future has a bearing on the past but did the past take into account the future
  </p>
 </body>
</html>