Boost logo

Boost Users :

Subject: Re: [Boost-users] [Geometry] Calculating distances on the earth
From: Barend Gehrels (barend_at_[hidden])
Date: 2012-03-04 12:01:52

Hi Sean,

On 4-3-2012 17:14, Sean Farrow wrote:
> Hi all:
> I need to calculate distances on the earth. Ideally I'd like to use
> the haversine formula.
> There is an example in the docs at:
> under the non-Cartesian heading.
> Will this do what I need, or do I need the Geographical coordinate
> system, (if yes where is this available and what features does this
> supply?)

This will do what you ask for. So it will calculate distances on the
Earth using the Haversine formula.

However, it considers the Earth as a perfect sphere, which it is not. So
distances are rough approximations.

If you need more precise results indeed you will need the Geographic
coordinate system, and the distances then use Andoyer which is much more

That is not included in the current Release. So if you need it you have
to download the Trunk of Boost, and it is there available as an extension.

See the examples here:

Regards, Barend

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at