To calculate geographic distances, a great circle route calculation is used.  
This is not the same thing as the simple calculation for distances between two 
points on a sphere.
In order to perform the calculation, various model parameters must be chosen, 
such as the ellipsoidal reference model.
To see examples of how this calculation is performed, see the code from the 
project proj.4:
https://trac.osgeo.org/proj/
I see that PostGIS uses proj.4, so if you have installed that package, you 
should be able to perform the calculations you wish to make.

From: pgsql-general-ow...@postgresql.org 
[mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Olivier Chaussavoine
Sent: Friday, August 9, 2013 12:30 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] earthdistance

I develope a project openbarter that needs to match objects based on a maximum 
distance between their positions on earth. I saw that the documentation of the 
extension earthdistance was interesting, but the promise was not in the code. 
It would  be nice to have these functions available independently of 
sophisticated geographic systems. There is a circle object for flat two 
dimensional space, but earth deals with spherical caps. It would not be exact 
but enough to suppose that earth is a sphere and that all dimensions latitude, 
longitude and distance are in radian.
What would need to be done to adapt the circle type to a new type 'spherical 
cap' that would allow simple geographic indexing?

--
Olivier Chaussavoine

Reply via email to