Re: Need Help to implement Proximity search feature

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Need Help to implement Proximity search feature
Date: 2014-01-16 19:49:17
Message-ID: 52D837BD.5000005@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bartosz Dmytrak 2014-01-16 21:09:13 Re: Any freeware graphic display of DDL software available?
Previous Message Rémi Cura 2014-01-16 19:39:03 Re: expert : SRF returning double[]