Re: [Boost-users] boost::geometry::index::rtree with CoordinateSystem
Hi,
I am trying to build a rtree index with a collection of waypoint (about 30.000) each represented by longitude and latitude. When I use Cartesian coordinates rtree.query works as expected. However the results are slightly wrong because of my use of longitude,latitude in the cartesian domain.
I then tried to refine the datatypes to use spherical_equatorial and geographic CoordinateSystem. Now I encounter two problems: a)With geographic, it does not compile. b)With spherical_equatorial query(nearest) gives clearly wrong results.
Do you have any clues on what I am doing wrong?
Everything you're doing is ok.
The support for coordinate systems other than cartesian is limited for now. As you noticed the nearest query gives >wrong results. Also the internal structure of the rtree may be not-optimal. At least the nearest query for spherical >CS should be fixed in upcoming Boost 1.56. Do you need some quick workaround?
As for geographic CS, it fails to compile because the default distance strategy isn't defined for this CS. It >probable that distance() is just not implemented yet for geographic CS but I must confirm it.
Could you please create tickets for those issues?
Regards, Adam
First: I am pretty impressed with the index::rtree template. It is *VERY* useful in my current project! Thanks for your reply! For my application, I am ok, for the moment, with the relatively small errors that using the cartesian domain gives me. I have created two tickets (9758 and 9759) What is the difference between spherical_equatorial and geographic and spherical? The documentation is rather unclear. Kind regards, Ola Martin
Hi, Ola Martin Lykkja wrote:
First: I am pretty impressed with the index::rtree template. It is *VERY* useful in my current project!
I'm glad that it's useful to you.
Thanks for your reply! For my application, I am ok, for the moment, with the relatively small errors that using the cartesian domain gives me. I have created two tickets (9758 and 9759)
Thanks.
What is the difference between spherical_equatorial and geographic and spherical? The documentation is rather unclear.
In both spherical CS points are on the surface of a sphere. In geographic, on the surface of an ellipsoid. In geographic and spherical_equatorial the latitude is in the range [-90S,90N] degrees. In spherical in the range [0N,180S]. More reading: http://en.wikipedia.org/wiki/Spherical_coordinate_system http://en.wikipedia.org/wiki/Equatorial_coordinate_system http://en.wikipedia.org/wiki/Colatitude http://en.wikipedia.org/wiki/Geographic_coordinate_system http://en.wikipedia.org/wiki/World_Geodetic_System http://en.wikipedia.org/wiki/Ellipsoid Regards, Adam
participants (2)
-
Adam Wulkiewicz
-
Ola Martin Lykkja