Boost logo

Geometry :

Subject: [ggl] Custom geometries and GGL header inclusion
From: feverzsj
Date: 2010-03-11 21:37:44

I have some custom geometries, and adapt them to GGL's geometry concept( by
adding partial specialization to boost::geometry::traits, just like the
registration macros, except macros can't handle template).
Then, I included some access, i/o headers from GGL, wrote a small routine,
compiled the source(with msvc9), but ended up with dozens errors.
After including several GGL core headers suggested by error info:

#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/coordinate_system.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
#include <boost/geometry/core/exterior_ring.hpp>
#include <boost/geometry/core/interior_rings.hpp>
#include <boost/geometry/multi/core/tags.hpp>
#include <boost/geometry/core/point_order.hpp>

, I made the routine run successfully.

Now, I want my geometries to work with GGL algorithm, so I simply include
some algorithm header from GGL. After compiling, the compiler generated
about 20 errors, most of them pointed to the
boost::geometry::strategy::not_implemented tag. I really have no idea about
what to include to make the compiler see these "strategies" (there are so
many headers in geometry/strategies) and make my geometries work with GGL
algorithms. Finally, I include these"all-in-one" headers suggested by wiki:

#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/multi/multi.hpp>

and make the routine pass the compiling.

It confused me a lot, since the way to use header in GGL is kinda different
from other boost lib. Usually, I want include as small range of headers as
possible. For example, if a GGL algorithm is needed and should be used with
custom geometry, I'd want only include one header for custom geometries and
one for the algorithm. But, actually, you need include lots of core,
strategy and algorithm headers to make it run.

View this message in context:
Sent from the Boost Geometry mailing list archive at

Geometry list run by mateusz at