<!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've tried:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>SELECT point_geom, location_id<BR> FROM
locations<BR> WHERE Distance(point_geom, 'POINT(-117.13538
32.6857)')<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>But get error: argument of WHERE must be type
boolean, not type double precision</FONT></DIV>
<P></P>
<P><FONT face=Arial size=2></FONT>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=adam@spatialsystems.org
href="mailto:adam@spatialsystems.org">Adam</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">PostGIS Users
Discussion</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, December 30, 2006 12:07
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [postgis-users] Finding Points
with distance to a location.</DIV>
<DIV><BR></DIV>
<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>
<P>
<HR>
<P></P>_______________________________________________<BR>postgis-users
mailing
list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE></BODY></HTML>