Modify

Ticket #6021 (closed Bugs: fixed)

Opened 3 years ago

Last modified 2 years ago

Cannot compile code to compute convex hull of multipoint geometry

Reported by: Crispin Cooper <cooperch@…> Owned by: barendgehrels
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

boost_geom_test_no_multipoint.cpp Download (587 bytes) - added by Crispin Cooper <cooperch@…> 3 years ago.

Change History

Changed 3 years ago by Crispin Cooper <cooperch@…>

comment:1 Changed 2 years ago by barendgehrels

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from To Be Determined to Boost 1.49.0

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.

comment:2 Changed 2 years ago by anonymous

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 Changed 2 years ago by barendgehrels

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>

Last edited 2 years ago by barendgehrels (previous) (diff)
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.