|
Geometry : |
Subject: [ggl] Difference / xor for multi polygons
From: Javier Gonzalez (xaviergonz)
Date: 2011-02-26 19:58:22
Wow, that was fast.
Unfortunately now upon compilation of the same code (VS2010), even if I only
leave the union inserterer, I get this:
1> BoostGeometry.cpp
1>Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(42): error C2664:
'boost::mpl::assertion_failed' : cannot convert parameter 1 from
'boost::mpl::failed ************(__cdecl
boost::geometry::traits::point_type<Geometry>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::*
***********)(boost::mpl::assert_::types<T1>)' to
'boost::mpl::assert<false>::type'
1> with
1> [
1> Geometry=std::vector<BoostGeometry::polygon_2d>,
1> T1=std::vector<BoostGeometry::polygon_2d>
1> ]
1> No constructor could take the source type, or constructor
overload resolution was ambiguous
1> Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(59) : see
reference to class template instantiation
'boost::geometry::traits::point_type<Geometry>' being compiled
1> with
1> [
1> Geometry=std::vector<BoostGeometry::polygon_2d>
1> ]
1> Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(115) : see
reference to class template instantiation
'boost::geometry::core_dispatch::point_type<Tag,Geometry>' being compiled
1> with
1> [
1> Tag=void,
1> Geometry=std::vector<BoostGeometry::polygon_2d>
1> ]
1> Programming\C++
Libraries\boost_1_46_0\boost/geometry/strategies/intersection.hpp(46) : see
reference to class template instantiation
'boost::geometry::point_type<Geometry>' being compiled
1> with
1> [
1> Geometry=BoostGeometry::polygon_2d_list
1> ]
1> Programming\C++
Libraries\boost_1_46_0\boost/geometry/algorithms/intersection_inserter.hpp(474)
: see reference to class template instantiation
'boost::geometry::strategy_intersection<Tag,Geometry1,Geometry2,IntersectionPoint>'
being compiled
1> with
1> [
1> Tag=boost::geometry::cartesian_tag,
1> Geometry1=BoostGeometry::polygon_2d_list,
1> Geometry2=BoostGeometry::polygon_2d_list,
1>
IntersectionPoint=boost::geometry::model::point<double,0x02,boost::geometry::cs::cartesian>
1> ]
1> ..\Clipper_Shared\BoostGeometry.cpp(29) : see reference to
function template instantiation 'OutputIterator
boost::geometry::intersection_inserter<BoostGeometry::polygon_2d,BoostGeometry::polygon_2d_list,BoostGeometry::polygon_2d_list,std::back_insert_iterator<_Container>>(const
Geometry1 &,const Geometry2 &,OutputIterator)' being compiled
1> with
1> [
1>
OutputIterator=std::back_insert_iterator<BoostGeometry::polygon_2d_list>,
1> _Container=BoostGeometry::polygon_2d_list,
1> Geometry1=BoostGeometry::polygon_2d_list,
1> Geometry2=BoostGeometry::polygon_2d_list
1> ]
1>Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(42): error C2866:
'boost::geometry::traits::point_type<Geometry>::mpl_assertion_in_line_19' :
a const static data member of a managed type must be initialized at the
point of declaration
1> with
1> [
1> Geometry=std::vector<BoostGeometry::polygon_2d>
1> ]
1>Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(59): error C2039:
'type' : is not a member of 'boost::geometry::traits::point_type<Geometry>'
1> with
1> [
1> Geometry=std::vector<BoostGeometry::polygon_2d>
1> ]
1>Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(60): error C3203:
'type' : unspecialized class template can't be used as a template argument
for template parameter 'T', expected a real type
1>Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(60): error C2955:
'boost::type' : use of class template requires template argument list
1> Programming\C++ Libraries\boost_1_46_0\boost/type.hpp(14) : see
declaration of 'boost::type'
1>Programming\C++
Libraries\boost_1_46_0\boost/geometry/core/point_type.hpp(60): error C2955:
'boost::remove_const' : use of class template requires template argument
list
1> Programming\C++
Libraries\boost_1_46_0\boost/type_traits/remove_const.hpp(73) : see
declaration of 'boost::remove_const'
I'm using the version from
Subversion repository with source code of *Boost Geometry* is hosted in the
Boost Trunk available at
svn co http://svn.boost.org/svn/boost/trunk/boost/geometry boost-geometry
though I only got the geometry part and used it over the release version of
boost 1.46
Probably the problem is that I need to get the whole development version of
boot itself? (I'm downloading it from SVN as I write this email, but it is
so slowwwww)
On Sat, Feb 26, 2011 at 11:56 PM, Barend Gehrels <barend_at_[hidden]> wrote:
>
> But there seems to be no multi algorithms for difference and sym
>>> difference (xor)
>>>
>>
>> difference and sym_difference work for with multi-geometries as output,
>> but the inserter is missing. I noticed that this week writing their
>> documentation. Will be added. Thanks for the notice.
>>
>
> Done.
>
> By the way, note, in your example, that returning a polygon_2d_list from a
> function is not efficient (unless you use C++0x with move constructors).
>
>
Thanks for the catch :) I think c# and java are slowly driving me to the
dark side.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20110227/ab166133/attachment-0001.html
Geometry list run by mateusz at loskot.net