|
Geometry : |
Subject: [ggl] intersection() and mixed geometries
From: Bill Zissimopoulos (ggl)
Date: 2010-10-02 15:54:43
Bruno, thank you for your continued support.
> Yes, it should work. Can you please give the compiler errors you get?
> (just for the first failing line please, to simplify)
Here is the first error message, when I try to do intersection(L1, A2, L):
<<
../../ext/boost-geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp: In function 'OutputIterator boost::geometry::detail::overlay::assemble(const Rings&, const Map&, const Geometry1&, const Geometry2&, int, bool, bool, OutputIterator) [with GeometryOut = GeoKit::impl::_GeometryLinestring, Rings = std::vector<GeoKit::impl::_GeometryLinestring, std::allocator<GeoKit::impl::_GeometryLinestring> >, Map = std::map<boost::geometry::ring_identifier, int, std::less<boost::geometry::ring_identifier>, std::allocator<std::pair<const boost::geometry::ring_identifier, int> > >, Geometry1 = GeoKit::impl::_GeometryMultiLinestring, Geometry2 = GeoKit::impl::_GeometryMultiPolygon, OutputIterator = std::back_insert_iterator<GeoKit::impl::_GeometryMultiLinestring>]':
../../ext/boost-geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp:795: instantiated from 'static OutputIterator boost::geometry::detail::overlay::overlay<Geometry1, Geometry2, OutputIterator, GeometryOut, Direction, Strategy>::apply(const Geometry1&, const Geometry2&, OutputIterator, const Strategy&) [with Geometry1 = GeoKit::impl::_GeometryMultiLinestring, Geometry2 = GeoKit::impl::_GeometryMultiPolygon, OutputIterator = std::back_insert_iterator<GeoKit::impl::_GeometryMultiLinestring>, GeometryOut = GeoKit::impl::_GeometryLinestring, int Direction = -0x00000000000000001, Strategy = boost::geometry::strategy_intersection<boost::geometry::cartesian_tag, GeoKit::impl::_GeometryMultiLinestring, GeoKit::impl::_GeometryMultiPolygon, GeoKit::impl::Point, void>]'
../../ext/boost-geometry/boost/geometry/algorithms/intersection.hpp:308: instantiated from 'OutputIterator boost::geometry::intersection_inserter(const Geometry1&, const Geometry2&, OutputIterator, const Strategy&) [with GeometryOut = GeoKit::impl::_GeometryLinestring, Geometry1 = GeoKit::impl::_GeometryMultiLinestring, Geometry2 = GeoKit::impl::_GeometryMultiPolygon, OutputIterator = std::back_insert_iterator<GeoKit::impl::_GeometryMultiLinestring>, Strategy = boost::geometry::strategy_intersection<boost::geometry::cartesian_tag, GeoKit::impl::_GeometryMultiLinestring, GeoKit::impl::_GeometryMultiPolygon, GeoKit::impl::Point, void>]'
../../ext/boost-geometry/boost/geometry/algorithms/intersection.hpp:394: instantiated from 'void boost::geometry::intersection(const Geometry1&, const Geometry2&, Collection&) [with Geometry1 = GeoKit::impl::_GeometryMultiLinestring, Geometry2 = GeoKit::impl::_GeometryMultiPolygon, Collection = GeoKit::impl::_GeometryMultiLinestring]'
/Users/billziss/Projects/nav/base/cross/GeoKit/1.0/build/Xcode/../../src/GeoKit/impl/Geometry.cpp:454: instantiated from here
../../ext/boost-geometry/boost/geometry/algorithms/detail/overlay/assemble.hpp:651: error: 'apply' is not a member of 'boost::geometry::detail::overlay::add_to_containment<boost::geometry::multi_linestring_tag, GeoKit::impl::_GeometryMultiLinestring>'
>>
The types _GeometryMultiLinestring and _GeometryMultiPolygon have been defined as follows:
struct _GeometryMultiLinestring : std::vector<_GeometryLinestring>
{
};
struct _GeometryMultiPolygon : std::vector<_GeometryPolygon>
{
};
The following tags have also been defined:
namespace boost { namespace geometry { namespace traits {
template <> struct tag<GeoKit::impl::_GeometryMultiPoint>
{
typedef multi_point_tag type;
};
template <> struct tag<GeoKit::impl::_GeometryMultiLinestring>
{
typedef multi_linestring_tag type;
};
template <> struct tag<GeoKit::impl::_GeometryMultiPolygon>
{
typedef multi_polygon_tag type;
};
}}}
Thank you,
Bill
Geometry list run by mateusz at loskot.net