Boost C++ Libraries: Ticket #9758: boost::geometry::index::rtree does not compile with CoordinateSystem geographic< https://svn.boost.org/trac10/ticket/9758 <p> boost::geometry::index::rtree does not compile with <a class="missing wiki">CoordinateSystem</a> geographic&lt; </p> <p> <a class="missing wiki">CoordinateSystem</a> cartesian is ok </p> <p> Example program: </p> <pre class="wiki">typedef bg::model::point&lt;double, 2, bg::cs::cartesian&gt; geo_point_ok; typedef bg::model::point&lt;double, 2, bg::cs::geographic&lt;bg::degree&gt; &gt; geo_point; typedef std::pair&lt;geo_point, unsigned int&gt; geo_vg_value; void test() { double lon=10.0, lat=60.0; geo_point pt(on, lat); rtree.insert(std::make_pair(pt, wp-&gt;id)); std::vector&lt;geo_vg_value&gt; result; geo_point here(targetLat, targetLat); rtree.query(bgi::nearest(here, 20), std::back_inserter(result)); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9758 Trac 1.4.3 awulkiew Sat, 12 Jul 2014 00:29:13 GMT <link>https://svn.boost.org/trac10/ticket/9758#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9758#comment:1</guid> <description> <p> In 1.56 the geometry::comparable_distance() is used by the nearest query. After adding the support for geographic CS in this algorithm the rtree should work automatically. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>awulkiew</dc:creator> <pubDate>Sat, 12 Jul 2014 00:30:16 GMT</pubDate> <title>type changed https://svn.boost.org/trac10/ticket/9758#comment:2 https://svn.boost.org/trac10/ticket/9758#comment:2 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> </ul> Ticket djh Thu, 30 Jul 2015 01:46:31 GMT <link>https://svn.boost.org/trac10/ticket/9758#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9758#comment:3</guid> <description> <p> Is there a workaround in the meantime? </p> <p> That is how do I tell Boost.Geometry to derive the distance between two points in the geographic coordinate system? From an implementation standpoint, I think this should be easily doable using e.g. the Haversine formula. </p> <p> Is there a quick fix that lets the RTree work with (longitude, latitude)-pairs or similar in the geographical coordinate system? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>awulkiew</dc:creator> <pubDate>Mon, 25 Apr 2016 11:26:59 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9758#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9758#comment:4</guid> <description> <p> If haversine distance is good for you, instead of geographic CS you could use spherical_equatorial. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 07 Apr 2018 07:12:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9758#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9758#comment:5</guid> <description> <p> You need a point to MBR distance: <a class="ext-link" href="https://link.springer.com/chapter/10.1007/978-3-642-40235-7_9"><span class="icon">​</span>https://link.springer.com/chapter/10.1007/978-3-642-40235-7_9</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>