Boost.Geometry    Boost C++ Libraries

Compiling

Compiling Boost.Geometry

Boost.Geometry is a Header Only library. So just including the headerfiles is enough to use the algorithms. Nothing has to be linked.

Boost.Geometry is only dependant on (header only) Boost libraries. Download the Boost Library Collection from www.boost.org, adapt the include path to include Boost.

Platforms

The library currently compiles successfully on the following platforms:

For Visual Studio, the examples contains some project files (for 2005). However, because the library is header only, it will be no problem to integrate it in your own project files.

The test and example folders contain also Jam-files for bjam / boost-build

For gcc, the flag -Wno-long-long can be used (surpressing warnings originating from Boost)

Convenient includes

This section concentrates on how to include GGL.

The most convenient headerfile including all algorithms and strategies is geometry.hpp:

An often used headerfile is geometries.hpp:

For users using only Cartesian points, with floating point coordinates (double), in 2D or 3D, you can use instead:

For users using multi-geometries:

Advanced includes

This section is for users who have their own geometries and want to use algorithms from the Boost.Geometry.

If you want to use your own points it makes sense to use the registration macro's:

If you are using standard containers containing points and want to handle them as a linestring

If you are using boost tuples and want to handle them as Cartesian points

Extensions

The GGL is currently (since 0.5) split into the kernel and several extensions. As this split is relatively new, there are not yet umbrella-include files, but most things below will do:

If you want to use the geographic coordinate system:

If you want to use the projections:

If you want to use the circle (n-sphere)

Performance

The enumeration below is not exhaustive but can contain hints to improve the performance

Intellisense issues

Microsoft Visual Studio (Express) 2005 and 2008 can hang typing in a bracket or angle bracket. This is not directly related to GGL, but caused by heavy templated libraries such as Boost and GGL. If this is inconvenient, intellisense can easily be turned off:

(...) disabling Intellisense in VC++. There is a file called feacp.dll in <VS8INSTALL>/VC/vcpackages folder. Renaming this file will disable Intellisense feature.

Source: http://blogs.msdn.com/yash/archive/2007/09/19/intellisense-issues-in-visual-c-2005.aspx


December 1, 2009

Copyright © 1995-2009 Barend Gehrels, Geodan, Amsterdam
Copyright © 2008-2009 Bruno Lalande, Paris
Copyright © 2009 Mateusz Loskot, Cadcorp, London
Documentation is generated by Doxygen