Boost C++ Libraries: Ticket #6021: Cannot compile code to compute convex hull of multipoint geometry https://svn.boost.org/trac10/ticket/6021 <p> Hello once again... </p> <p> Attached is a program to compute the convex hull of a multipoint geometry. Compilation fails (msvc). </p> <p> Compilation works if either a polygon is used instead of a multipoint, or the convex_hull function is not called. </p> <p> Compiler output pasted below. </p> <p> Many thanks for developing this useful library, I hope this is me failing to use it correctly rather than problems your end! </p> <p> 1&gt;------ Build started: Project: boost_geom_test, Configuration: Debug Win32 ------ 1&gt;Compiling... 1&gt;boost_geom_test_no_multipoint.cpp 1&gt;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&lt;Tag,Geometry,Actor,<a class="missing wiki">IsConst</a>&gt;' 1&gt; with 1&gt; [ 1&gt; Tag=boost::geometry::multi_point_tag, 1&gt; Geometry=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; Actor=boost::geometry::strategy::convex_hull::detail::get_extremes&lt;range_type,range_iterator,boost::geometry::less&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,0&gt;,boost::geometry::greater&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,0&gt;&gt;, 1&gt; <a class="missing wiki">IsConst</a>=true 1&gt; ] 1&gt; 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&lt;<a class="missing wiki">InputGeometry</a>,boost::geometry::strategy::convex_hull::detail::get_extremes&lt;<a class="missing wiki">InputRange</a>,<a class="missing wiki">RangeIterator</a>,<a class="missing wiki">StrategyLess</a>,<a class="missing wiki">StrategyGreater</a>&gt;&gt;(const Geometry &amp;,Actor &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; <a class="missing wiki">InputGeometry</a>=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; <a class="missing wiki">InputRange</a>=range_type, 1&gt; <a class="missing wiki">RangeIterator</a>=range_iterator, 1&gt; <a class="missing wiki">StrategyLess</a>=boost::geometry::less&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,0&gt;, 1&gt; <a class="missing wiki">StrategyGreater</a>=boost::geometry::greater&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,0&gt;, 1&gt; Geometry=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; Actor=boost::geometry::strategy::convex_hull::detail::get_extremes&lt;range_type,range_iterator,boost::geometry::less&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,0&gt;,boost::geometry::greater&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,0&gt;&gt; 1&gt; ] 1&gt; 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&lt;<a class="missing wiki">InputGeometry</a>,<a class="missing wiki">OutputPoint</a>&gt;::apply(const <a class="missing wiki">InputGeometry</a> &amp;,boost::geometry::strategy::convex_hull::graham_andrew&lt;<a class="missing wiki">InputGeometry</a>,<a class="missing wiki">OutputPoint</a>&gt;::partitions &amp;) const' 1&gt; with 1&gt; [ 1&gt; <a class="missing wiki">InputGeometry</a>=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; <a class="missing wiki">OutputPoint</a>=point_type 1&gt; ] 1&gt; 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&lt;<a class="missing wiki">InputGeometry</a>,<a class="missing wiki">OutputPoint</a>&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; <a class="missing wiki">InputGeometry</a>=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; <a class="missing wiki">OutputPoint</a>=point_type 1&gt; ] 1&gt; d:\test\boost_geom_test\boost_geom_test_no_multipoint.cpp(20) : see reference to function template instantiation 'void boost::geometry::convex_hull&lt;boost::geometry::model::multi_point&lt;Point&gt;,boost::geometry::model::polygon&lt;Point&gt;&gt;(const Geometry1 &amp;,Geometry2 &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Point=boost::geometry::model::d2::point_xy&lt;float&gt;, 1&gt; Geometry1=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; Geometry2=boost::geometry::model::polygon&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt; 1&gt; ] 1&gt;d:\boost\boost_1_47_0\boost\geometry\algorithms\detail\for_each_range.hpp(115) : error C3861: 'apply': identifier not found 1&gt;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&lt;Tag,Geometry,Actor,<a class="missing wiki">IsConst</a>&gt;' 1&gt; with 1&gt; [ 1&gt; Tag=boost::geometry::multi_point_tag, 1&gt; Geometry=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; Actor=boost::geometry::strategy::convex_hull::detail::assign_range&lt;range_type,range_iterator,std::vector&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,std::allocator&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;&gt;,boost::geometry::strategy::side::side_by_triangle&lt;void&gt;&gt;, 1&gt; <a class="missing wiki">IsConst</a>=true 1&gt; ] 1&gt; 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&lt;<a class="missing wiki">InputGeometry</a>,boost::geometry::strategy::convex_hull::detail::assign_range&lt;<a class="missing wiki">InputRange</a>,<a class="missing wiki">RangeIterator</a>,Container,<a class="missing wiki">SideStrategy</a>&gt;&gt;(const Geometry &amp;,Actor &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; <a class="missing wiki">InputGeometry</a>=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; <a class="missing wiki">InputRange</a>=range_type, 1&gt; <a class="missing wiki">RangeIterator</a>=range_iterator, 1&gt; Container=std::vector&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,std::allocator&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;&gt;, 1&gt; <a class="missing wiki">SideStrategy</a>=boost::geometry::strategy::side::side_by_triangle&lt;void&gt;, 1&gt; Geometry=boost::geometry::model::multi_point&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;, 1&gt; Actor=boost::geometry::strategy::convex_hull::detail::assign_range&lt;range_type,range_iterator,std::vector&lt;boost::geometry::model::d2::point_xy&lt;float&gt;,std::allocator&lt;boost::geometry::model::d2::point_xy&lt;float&gt;&gt;&gt;,boost::geometry::strategy::side::side_by_triangle&lt;void&gt;&gt; 1&gt; ] 1&gt;d:\boost\boost_1_47_0\boost\geometry\algorithms\detail\for_each_range.hpp(115) : error C3861: 'apply': identifier not found 1&gt;Build log was saved at "<a class="ext-link" href="file://d:\test\boost_geom_test\Debug\BuildLog.htm"><span class="icon">​</span>file://d:\test\boost_geom_test\Debug\BuildLog.htm</a>" 1&gt;boost_geom_test - 4 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6021 Trac 1.4.3 Crispin Cooper <cooperch@…> Thu, 13 Oct 2011 15:09:46 GMT attachment set https://svn.boost.org/trac10/ticket/6021 https://svn.boost.org/trac10/ticket/6021 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_geom_test_no_multipoint.cpp</span> </li> </ul> Ticket Barend Gehrels Sat, 14 Jan 2012 14:27:50 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/6021#comment:1 https://svn.boost.org/trac10/ticket/6021#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.49.0</span> </li> </ul> <p> 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. </p> <p> Thanks for the ticket and attachment. </p> Ticket anonymous Tue, 24 Jan 2012 15:18:34 GMT <link>https://svn.boost.org/trac10/ticket/6021#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6021#comment:2</guid> <description> <p> 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. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Sun, 05 Feb 2012 11:34:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6021#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6021#comment:3</guid> <description> <p> Right, append was there but missing in the multi.hpp. Fixed, thanks. Note also that it is now necessary to include point_xy: </p> <pre class="wiki">#include &lt;boost/geometry/geometries/point_xy.hpp&gt; </pre> </description> <category>Ticket</category> </item> </channel> </rss>