Boost C++ Libraries: Ticket #12410: boost::geometry::correct on a polygon in a geographic cs doesn't work
https://svn.boost.org/trac10/ticket/12410
<p>
It doesn't compile. See this simple example (and yes, I know the polygon is empty. That doesn't matter)
</p>
<pre class="wiki">#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/geometries.hpp>
int main()
{
typedef boost::geometry::model::polygon
<
boost::geometry::model::point<double, 2, boost::geometry::cs::geographic<boost::geometry::degree>>
> polygon_t;
polygon_t poly;
boost::geometry::correct( poly );
return 0;
}
</pre><p>
Compiler output :
</p>
<p>
1>------ Build started: Project: boostscratch10, Configuration: Debug Win32 ------
1> main.cpp
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\area.hpp(41): error C2664: 'int boost::mpl::assertion_failed<false>(boost::mpl::assert<false>::type)': cannot convert argument 1 from 'boost::mpl::failed <strong></strong><strong></strong><strong></strong>(<span class="underline">thiscall boost::geometry::strategy::area::services::default_strategy<boost::geometry::geographic_tag,boost::geometry::model::point<double,2,boost::geometry::cs::geographic<boost::geometry::degree>>>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE::* <strong></strong><strong></strong><strong>*)(boost::mpl::assert_::types<<a class="missing wiki">PointOfSegment</a>,boost::mpl::na,boost::mpl::na,boost::mpl::na>)' to 'boost::mpl::assert<false>::type'
1> with
1> [
1> <a class="missing wiki">PointOfSegment</a>=boost::geometry::model::point<double,2,boost::geometry::cs::geographic<boost::geometry::degree>>
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\area.hpp(41): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(42): note: see reference to class template instantiation 'boost::geometry::strategy::area::services::default_strategy<boost::geometry::geographic_tag,boost::geometry::model::point<double,2,boost::geometry::cs::geographic<boost::geometry::degree>>>' being compiled
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(177): note: see reference to class template instantiation 'boost::geometry::default_area_result<Polygon>' being compiled
1> with
1> [
1> Polygon=polygon_t
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(247): note: see reference to class template instantiation 'boost::geometry::detail::correct::correct_polygon<Polygon>' being compiled
1> with
1> [
1> Polygon=polygon_t
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(287): note: see reference to class template instantiation 'boost::geometry::dispatch::correct<Geometry,boost::geometry::polygon_tag>' being compiled
1> with
1> [
1> Geometry=polygon_t
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(285): note: while compiling class template member function 'void boost::geometry::resolve_variant::correct<Geometry>::apply(Geometry &)'
1> with
1> [
1> Geometry=polygon_t
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(328): note: see reference to function template instantiation 'void boost::geometry::resolve_variant::correct<Geometry>::apply(Geometry &)' being compiled
1> with
1> [
1> Geometry=polygon_t
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(328): note: see reference to class template instantiation 'boost::geometry::resolve_variant::correct<Geometry>' being compiled
1> with
1> [
1> Geometry=polygon_t
1> ]
1> c:\users\sesa408586\documents\visual studio 2015\projects\boostscratch10\main.cpp(14): note: see reference to function template instantiation 'void boost::geometry::correct<polygon_t>(Geometry &)' being compiled
1> with
1> [
1> Geometry=polygon_t
1> ]
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(42): error C2039: 'type': is not a member of 'boost::geometry::strategy::area::services::default_strategy<boost::geometry::geographic_tag,boost::geometry::model::point<double,2,boost::geometry::cs::geographic<boost::geometry::degree>>>'
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(38): note: see declaration of 'boost::geometry::strategy::area::services::default_strategy<boost::geometry::geographic_tag,boost::geometry::model::point<double,2,boost::geometry::cs::geographic<boost::geometry::degree>>>'
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(44): error C2955: 'boost::type': use of class template requires template argument list
1> d:\boost_1_61_0\boost_1_61_0\boost\type.hpp(14): note: see declaration of 'boost::type'
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(44): error C2039: 'return_type': is not a member of 'boost::type'
1> d:\boost_1_61_0\boost_1_61_0\boost\type.hpp(14): note: see declaration of 'boost::type'
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(44): error C3646: 'type': unknown override specifier
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\strategies\default_area_result.hpp(44): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(177): error C2039: 'type': is not a member of 'boost::geometry::default_area_result<Polygon>'
1> with
1> [
1> Polygon=polygon_t
1> ]
1> d:\boost_1_61_0\boost_1_61_0\boost\geometry\algorithms\correct.hpp(177): note: see declaration of 'boost::geometry::default_area_result<Polygon>'
1> with
1> [
1> Polygon=polygon_t
1> ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
</strong></span></p>
en-usBoost C++ Libraries/htdocs/site/boost.png
https://svn.boost.org/trac10/ticket/12410
Trac 1.4.3awulkiewThu, 20 Apr 2017 16:57:51 GMTstatus, type, milestone changed; keywords, resolution set
https://svn.boost.org/trac10/ticket/12410#comment:1
https://svn.boost.org/trac10/ticket/12410#comment:1
<ul>
<li><strong>keywords</strong>
area correct geographic added
</li>
<li><strong>status</strong>
<span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span>
</li>
<li><strong>type</strong>
<span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</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.64.0</span>
</li>
</ul>
<p>
Added support for geographic CS in area() fixes compilation error in correct():
</p>
<p>
<a class="ext-link" href="https://github.com/boostorg/geometry/pull/359"><span class="icon"></span>https://github.com/boostorg/geometry/pull/359</a>
</p>
Ticket