Re: Need Help to implement Proximity search feature - Mailing list pgsql-general

From John R Pierce
Subject Re: Need Help to implement Proximity search feature
Date
Msg-id 52D837BD.5000005@hogranch.com
Whole thread Raw
In response to Re: Need Help to implement Proximity search feature  (itishree sukla <itishree.sukla@gmail.com>)
List pgsql-general
On 1/16/2014 1:52 AM, itishree sukla wrote:
> we have Database, but not ready for Geocode use.  what i understood
> from different blog, we should have latitude and longitude either
> based on addresses, or postal code we have. However if I will get the
> lat and long, need to calculate earth distance to give  location based
> on user location. Formula i got, is calculating shortest distance,
> which always not true practically. Please address my concern, how i
> will get rid of these issues.

for determining closest proximity, you probably don't need accurate
spherical earth distance, simple cartesian distance is good enough as
you're only interested in relative values.  for this, you can use the
built in postgresql POINT data type, and the <->  distance operator.



--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



pgsql-general by date:

Previous
From: Rémi Cura
Date:
Subject: Re: expert : SRF returning double[]
Next
From: Bartosz Dmytrak
Date:
Subject: Re: Any freeware graphic display of DDL software available?