Search Postgresql Archives

Re: earthdistance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Aug 10, 2013 at 12:18:48 +0200,
  Olivier Chaussavoine <olivier.chaussavoine@xxxxxxxxx> wrote:
I did not found any geographic indexing with earthdistance, and need it.

Some of the earthdistance stuff is based on cube which does have indexing. I don't know how well that indexing works and it might be pretty bad in practice.

The need I have is simple:
"is the distance between two (lat,long) positions less than X km?"
the model used for the shape of the earth should be related to the
precision of lat,lon, and most sources are imprecise. The spherical model
should be enough.

You might just be looking at this wrong. You don't have an index on the distance. What you want is to find points within a cube that is big enough to include all of the points of interest and then double check the returned points to make sure they are really within the expected range. You can calculate the size of the cube needed based on the distance and the radius of the earth. I don't remember if there was a built in function for that, since it's been such a long time since I looked at it.


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux