Received: from summersault.com (qmailr@nollie.summersault.com [199.120.185.41]) by hub.org (8.9.3/8.9.3) with SMTP id NAA74158 for ; Sat, 22 Jan 2000 13:04:50 -0500 (EST) (envelope-from mark@summersault.com) Received: (qmail 69199 invoked from network); 22 Jan 2000 18:04:49 -0000 Received: from mark.summersault.com (HELO summersault.com) (199.120.185.113) by nollie.summersault.com with SMTP; 22 Jan 2000 18:04:49 -0000 Message-ID: <3889F141.4540F4B5@summersault.com> Date: Sat, 22 Jan 2000 13:06:39 -0500 From: Mark Stosberg Reply-To: mark@summersault.com Organization: Summersault X-Mailer: Mozilla 4.7 (Macintosh; I; PPC) X-Accept-Language: en,pdf MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: geo_distance radius question Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello! I'm writing regarding your earthdistance postgres extension (included in the standard distro of 6.5.3). I would like to use it as part of a geo spatial search engine I'm using to help folks find resources related to skateparks on http://www.skatepark.org/ I got it installed, and the test script ran fine, but I'm running into a syntax issue. I'm guessing the fault has to be with me being to new using postgres extensions and working with custom operators. So want I want to do is to find all the zipcodes that are within a radius of 500 miles of an initial zipcode. So geo_distance code installed, I put together a statement like this: SELECT zipcode,latitude,longitude,city,state_abbrev from zip WHERE (geo_distance ('(117.59408,34.107039)'::point,'(longitude,latitude)'::point) < 500 ). I also tried this: SELECT zipcode,latitude,longitude,city,state_abbrev from zip WHERE ('(117.59408,34.107039 )'::point <@> '(longitude,latitude)'::point) < 500; However, I get this response back in both cases "ERROR: Bad point external representation '(longitude,latitude)" So it appears postgres may be taking the words 'longitude' and 'latitude' literal there, when I really want it to refer to values for those columns. It seems like there's a straightforward solution, but I'm missing it. Do you have any suggestions? Thanks! -mark <<-------------------------------------------------------------->> personal website < Summersault Website Design http://mark.stosberg.com/ > http://www.summersault.com/