Boost logo

Geometry :

Subject: [ggl] Using ggl with boost
From: Ivan Marin (ispmarin)
Date: 2009-09-02 18:02:02


Hello all,

Maybe this is a rather easy question, but I was unable to use ggl. I
downloaded boost 1.40 from the boost site, and downloaded the ggl. Copied
the geometry directory to boost_1_40_0 directory, and included the headers
like this:

#include "geometry/geometry.hpp"
#include "geometry/geometries/cartesian2d.hpp"

int main () {
  using namespace geometry;
    polygon_2d poly;
        {
                const double coor[][2] = {
                        {2.0, 1.3}, {2.4, 1.7}, {2.8, 1.8}, {3.4, 1.2},
{3.7, 1.6},
                        {3.4, 2.0}, {4.1, 3.0}, {5.3, 2.6}, {5.4, 1.2},
{4.9, 0.8}, {2.9, 0.7},
                        {2.0, 1.3} // closing point is opening point
                        };
                assign(poly, coor);
        }
return 0;

}

And then tried to compile with
g++ -I boost_1_40_0 polygon.cpp -o polygon
But it gave me the errors:

boost_1_40_0/geometry/core/coordinate_system.hpp: In instantiation of
?geometry::core_dispatch::coordinate_system<geometry::point_tag, double
[2]>?:
boost_1_40_0/geometry/core/coordinate_system.hpp:72: instantiated from
?geometry::coordinate_system<double [2]>?
boost_1_40_0/geometry/core/concepts/point_concept.hpp:111: instantiated
from ?geometry::ConstPoint<double [2]>?
boost_1_40_0/boost/concept/detail/has_constraints.hpp:40: instantiated
from ?const bool boost::concept::not_satisfied<geometry::ConstPoint<double
[2]> >::value?
boost_1_40_0/boost/concept/detail/has_constraints.hpp:43: instantiated
from ?boost::concept::not_satisfied<geometry::ConstPoint<double [2]> >?
boost_1_40_0/boost/mpl/if.hpp:67: instantiated from
?boost::mpl::if_<boost::concept::not_satisfied<geometry::ConstPoint<double
[2]> >, boost::concept::constraint<geometry::ConstPoint<double [2]> >,
boost::concept::requirement<geometry::ConstPoint<double [2]> > >?
boost_1_40_0/boost/concept/detail/general.hpp:19: instantiated from
?boost::concept::requirement_<void (*)(geometry::ConstPoint<double [2]>)>?
boost_1_40_0/boost/concept/requires.hpp:31: instantiated from
?boost::_requires_<void (*)(geometry::ConstPoint<double [2]>)>?
boost_1_40_0/geometry/algorithms/append.hpp:62: instantiated from ?static
void geometry::impl::append::append_point<G, P, true>::run(G&, const P&,
int, int) [with G = geometry::linear_ring<geometry::point_xy<double,
geometry::cs::cartesian>, std::vector, std::allocator>, P = double [2]]?
boost_1_40_0/geometry/algorithms/append.hpp:87: instantiated from ?static
void geometry::impl::append::append_range<G, R, STD>::run(G&, const R&, int,
int) [with G = geometry::linear_ring<geometry::point_xy<double,
geometry::cs::cartesian>, std::vector, std::allocator>, R = double [12][2],
bool STD = true]?
boost_1_40_0/geometry/algorithms/append.hpp:120: instantiated from ?static
void geometry::impl::append::range_to_poly<P, R, STD>::run(P&, const R&,
int, int) [with P = geometry::polygon<geometry::point_xy<double,
geometry::cs::cartesian>, std::vector, std::vector, std::allocator,
std::allocator>, R = double [12][2], bool STD = true]?
boost_1_40_0/geometry/algorithms/append.hpp:191: instantiated from ?void
geometry::append(G&, const ROP&, int, int) [with G =
geometry::polygon<geometry::point_xy<double, geometry::cs::cartesian>,
std::vector, std::vector, std::allocator, std::allocator>, ROP = double
[12][2]]?
boost_1_40_0/geometry/algorithms/assign.hpp:332: instantiated from ?void
geometry::assign(G&, const R&) [with G = geometry::polygon_2d, R = double
[12][2]]?
polygon.cpp:24: instantiated from here
boost_1_40_0/geometry/core/coordinate_system.hpp:56: error: no type named
?type? in ?struct geometry::traits::coordinate_system<double [2]>?

What am I doing wrong?

Thank you!

Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20090902/7102b1b5/attachment.html


Geometry list run by mateusz at loskot.net