Boost C++ Libraries: Ticket #12342: boost rtree and polygon with adapted point type doesn't compile https://svn.boost.org/trac10/ticket/12342 <p> I am using boost 1.61 </p> <p> Compiling with VS2015 </p> <p> The following code won't compile. I expect it to --- I think it is the use of the adapter BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET that is upsetting things. </p> <pre class="wiki">#include &lt;boost/geometry/geometry.hpp&gt; #include &lt;boost/geometry/index/rtree.hpp&gt; #include &lt;boost/geometry/geometries/polygon.hpp&gt; #include &lt;boost/geometry/geometries/point.hpp&gt; #include &lt;boost/geometry/io/wkt/wkt.hpp&gt; #include &lt;vector&gt; #include &lt;boost/geometry/geometries/register/point.hpp&gt; class wxPoint { public: wxPoint(double x, double y) : m_x(x), m_y(y) { } wxPoint() {} double getx() const { return m_x; } double gety() const { return m_y; } void setx(double in) { m_x = in; } void sety(double in) { m_y = in; } private: double m_x; double m_y; }; BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET( wxPoint, double, boost::geometry::cs::geographic&lt;boost::geometry::degree&gt;, wxPoint::getx, wxPoint::gety, wxPoint::setx, wxPoint::sety) typedef std::pair&lt;wxPoint, unsigned&gt; value; int main() { boost::geometry::index::rtree&lt; value, boost::geometry::index::quadratic&lt;16&gt; &gt; rtree; wxPoint p(4, 1); rtree.insert(std::make_pair(p, 1)); std::vector&lt;value&gt; result_s; typedef boost::geometry::model::polygon&lt;wxPoint&gt; polygon_type; polygon_type poly; boost::geometry::read_wkt( "POLYGON((2 1.3,2.4 1.7,2.8 1.8,3.4 1.2,3.7 1.6,3.4 2,4.1 3,5.3 2.6,5.4 1.2,4.9 0.8,2.9 0.7,2 1.3)" "(4.0 2.0, 4.2 1.4, 4.8 1.9, 4.4 2.2, 4.0 2.0))", poly); rtree.query(boost::geometry::index::within(poly), std::back_inserter(result_s)); return 0; } </pre><p> compiler output attached as a file </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12342 Trac 1.4.3 anonymoussoldevelopment1234@… Fri, 22 Jul 2016 08:14:55 GMT attachment set https://svn.boost.org/trac10/ticket/12342 https://svn.boost.org/trac10/ticket/12342 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">compileroutput.txt</span> </li> </ul> <p> compiler output </p> Ticket awulkiew Wed, 28 Dec 2016 15:10:30 GMT keywords, status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/12342#comment:1 https://svn.boost.org/trac10/ticket/12342#comment:1 <ul> <li><strong>keywords</strong> intersects box polygon added </li> <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.62.0</span> </li> </ul> <p> Thanks! </p> <p> This bug was fixed in Boost 1.62. </p> <p> Fix: <a class="ext-link" href="https://github.com/boostorg/geometry/commit/54de9f96a1b29d11e1a8044ac8fcc6accfa5201f"><span class="icon">​</span>https://github.com/boostorg/geometry/commit/54de9f96a1b29d11e1a8044ac8fcc6accfa5201f</a> </p> <p> It's more or less a duplicate of: <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/12189"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/12189</a>. More or less because in this case geometries are defined in non-cartesian CS. This bug is fixed in two ways in 1.62. The cartesian intersection strategy is fixed as mentioned above but also new spherical intersection strategy is introduced and used for geometries in non-cartesian coordinate systems. </p> Ticket