Hi:

Ok, thanks, What (roughly) is the difference in precision? I’m using this to determine the distance between two buildings.

Cheers

Sean.

**From:** boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] **On Behalf Of **Barend Gehrels**Sent:** 04 March 2012 17:02**To:** boost-users@lists.boost.org**Subject:** Re: [Boost-users] [Geometry] Calculating distances on the earth

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:

http://www.boost.org/doc/libs/1_49_0/libs/geometry/doc/html/geometry/quickstart.html

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 precise.

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:

https://svn.boost.org/svn/boost/trunk/libs/geometry/example_extensions/gis/latlong/

Regards, Barend