<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3020" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I figured this out last year, but can't figure out
how I figured it out. I've read "Mapping Hacks" and "Web Mapping
Illustrated" along with what I could find in the WIKI and documentation but
can't start to figure it out.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have my geometry column named "point_geom" and a
unique column named "location_id".</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I want to query the distance of all the points in
my "point_geom" column to coords: Long = -117.13538 :: Lat =
32.6857</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><STRONG>What would the query for this look
like? Is there a comprehensive article or book out that goes in depth into
how spatial queries work?</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The output would look like this:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>location_id | distance</FONT></DIV>
<DIV><FONT face=Arial size=2>-------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>5 | 45.38823</FONT></DIV>
<DIV><FONT face=Arial size=2>9 | 50.39952</FONT></DIV>
<DIV><FONT face=Arial size=2>1 | 82.39923</FONT></DIV>
<DIV><FONT face=Arial size=2>.</FONT></DIV>
<DIV><FONT face=Arial size=2>.</FONT></DIV>
<DIV><FONT face=Arial size=2>.</FONT></DIV>
<DIV><FONT face=Arial size=2>-------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm guessing that you'd use distance_spheroid
for the calculation. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>