#6021 closed Bugs (fixed)
Cannot compile code to compute convex hull of multipoint geometry
Reported by: | Owned by: | Barend Gehrels | |
---|---|---|---|
Milestone: | Boost 1.49.0 | Component: | geometry |
Version: | Boost 1.47.0 | Severity: | Showstopper |
Keywords: | convex hull multipoint | Cc: |
Description
Hello once again...
Attached is a program to compute the convex hull of a multipoint geometry. Compilation fails (msvc).
Compilation works if either a polygon is used instead of a multipoint, or the convex_hull function is not called.
Compiler output pasted below.
Many thanks for developing this useful library, I hope this is me failing to use it correctly rather than problems your end!
1>------ Build started: Project: boost_geom_test, Configuration: Debug Win32 ------ 1>Compiling... 1>boost_geom_test_no_multipoint.cpp 1>d:\boost\boost_1_47_0\boost\geometry\algorithms\detail\for_each_range.hpp(115) : error C2039: 'apply' : is not a member of 'boost::geometry::dispatch::for_each_range<Tag,Geometry,Actor,IsConst>' 1> with 1> [ 1> Tag=boost::geometry::multi_point_tag, 1> Geometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> Actor=boost::geometry::strategy::convex_hull::detail::get_extremes<range_type,range_iterator,boost::geometry::less<boost::geometry::model::d2::point_xy<float>,0>,boost::geometry::greater<boost::geometry::model::d2::point_xy<float>,0>>, 1> IsConst=true 1> ] 1> d:\boost\boost_1_47_0\boost\geometry\strategies\agnostic\hull_graham_andrew.hpp(294) : see reference to function template instantiation 'void boost::geometry::detail::for_each_range<InputGeometry,boost::geometry::strategy::convex_hull::detail::get_extremes<InputRange,RangeIterator,StrategyLess,StrategyGreater>>(const Geometry &,Actor &)' being compiled 1> with 1> [ 1> InputGeometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> InputRange=range_type, 1> RangeIterator=range_iterator, 1> StrategyLess=boost::geometry::less<boost::geometry::model::d2::point_xy<float>,0>, 1> StrategyGreater=boost::geometry::greater<boost::geometry::model::d2::point_xy<float>,0>, 1> Geometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> Actor=boost::geometry::strategy::convex_hull::detail::get_extremes<range_type,range_iterator,boost::geometry::less<boost::geometry::model::d2::point_xy<float>,0>,boost::geometry::greater<boost::geometry::model::d2::point_xy<float>,0>> 1> ] 1> d:\boost\boost_1_47_0\boost\geometry\strategies\agnostic\hull_graham_andrew.hpp(274) : while compiling class template member function 'void boost::geometry::strategy::convex_hull::graham_andrew<InputGeometry,OutputPoint>::apply(const InputGeometry &,boost::geometry::strategy::convex_hull::graham_andrew<InputGeometry,OutputPoint>::partitions &) const' 1> with 1> [ 1> InputGeometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> OutputPoint=point_type 1> ] 1> d:\boost\boost_1_47_0\boost\geometry\algorithms\convex_hull.hpp(179) : see reference to class template instantiation 'boost::geometry::strategy::convex_hull::graham_andrew<InputGeometry,OutputPoint>' being compiled 1> with 1> [ 1> InputGeometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> OutputPoint=point_type 1> ] 1> d:\test\boost_geom_test\boost_geom_test_no_multipoint.cpp(20) : see reference to function template instantiation 'void boost::geometry::convex_hull<boost::geometry::model::multi_point<Point>,boost::geometry::model::polygon<Point>>(const Geometry1 &,Geometry2 &)' being compiled 1> with 1> [ 1> Point=boost::geometry::model::d2::point_xy<float>, 1> Geometry1=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> Geometry2=boost::geometry::model::polygon<boost::geometry::model::d2::point_xy<float>> 1> ] 1>d:\boost\boost_1_47_0\boost\geometry\algorithms\detail\for_each_range.hpp(115) : error C3861: 'apply': identifier not found 1>d:\boost\boost_1_47_0\boost\geometry\algorithms\detail\for_each_range.hpp(115) : error C2039: 'apply' : is not a member of 'boost::geometry::dispatch::for_each_range<Tag,Geometry,Actor,IsConst>' 1> with 1> [ 1> Tag=boost::geometry::multi_point_tag, 1> Geometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> Actor=boost::geometry::strategy::convex_hull::detail::assign_range<range_type,range_iterator,std::vector<boost::geometry::model::d2::point_xy<float>,std::allocator<boost::geometry::model::d2::point_xy<float>>>,boost::geometry::strategy::side::side_by_triangle<void>>, 1> IsConst=true 1> ] 1> d:\boost\boost_1_47_0\boost\geometry\strategies\agnostic\hull_graham_andrew.hpp(307) : see reference to function template instantiation 'void boost::geometry::detail::for_each_range<InputGeometry,boost::geometry::strategy::convex_hull::detail::assign_range<InputRange,RangeIterator,Container,SideStrategy>>(const Geometry &,Actor &)' being compiled 1> with 1> [ 1> InputGeometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> InputRange=range_type, 1> RangeIterator=range_iterator, 1> Container=std::vector<boost::geometry::model::d2::point_xy<float>,std::allocator<boost::geometry::model::d2::point_xy<float>>>, 1> SideStrategy=boost::geometry::strategy::side::side_by_triangle<void>, 1> Geometry=boost::geometry::model::multi_point<boost::geometry::model::d2::point_xy<float>>, 1> Actor=boost::geometry::strategy::convex_hull::detail::assign_range<range_type,range_iterator,std::vector<boost::geometry::model::d2::point_xy<float>,std::allocator<boost::geometry::model::d2::point_xy<float>>>,boost::geometry::strategy::side::side_by_triangle<void>> 1> ] 1>d:\boost\boost_1_47_0\boost\geometry\algorithms\detail\for_each_range.hpp(115) : error C3861: 'apply': identifier not found 1>Build log was saved at "file://d:\test\boost_geom_test\Debug\BuildLog.htm" 1>boost_geom_test - 4 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Attachments (1)
Change History (4)
by , 11 years ago
Attachment: | boost_geom_test_no_multipoint.cpp added |
---|
comment:1 by , 11 years ago
Milestone: | To Be Determined → Boost 1.49.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 by , 11 years ago
I just tried a checkout from svn head, and when running the above, got an error about empty geometry. So append may still be faulty? Compiling/running on msvc under windows xp.
comment:3 by , 11 years ago
Right, append was there but missing in the multi.hpp. Fixed, thanks. Note also that it is now necessary to include point_xy:
#include <boost/geometry/geometries/point_xy.hpp>
There were some issues here, append did not work for multi_point (fixed) and this caused another error (convex hull did not throw an exception on an empty geometry), fixed.
Thanks for the ticket and attachment.