I am new to R-Tree and I want to build a R-Tree indexing for a road network. The road network have Nodes (node id, longitude, and latitude) and Edges (edge id, source id, destination id, distance ). I understand the leaves of an R-Tree are bounding boxes (the rectangles). How can I decide which data to put in a bounding box, should I put the node points with longitude and latitudes or the edges with source and destination segments? As the road network contains millions of nodes and edges to minimize the overlaps?
-
The point of an index is that it allows to quickly search and find data. The question you should answer first is: which data do you need? If you need nodes you should index nodes. If you needs edges you should index edges. If you need both than you can use two separate indexes or you can put points and edges into the same index (a points is just an edge that starts and ends at the same point).TilmannZ– TilmannZ2022-02-11 15:10:59 +00:00Commented Feb 11, 2022 at 15:10
-
I still haven't figured that out yet. I think I will stick to edge indexing. Or may be the last suggestion that you have mentioned. I have found one framework in github. link. However, I have no prior experience of this framework. I am going through the documentation. Please share your experience if you have @TilmannZAavash Bhandari– Aavash Bhandari2022-02-13 09:22:33 +00:00Commented Feb 13, 2022 at 9:22
-
There is also another implementation here (self advertisement). This may be useful because you can also swap out the R-tree for other indexes such as quadtrees, kd-trees (for points only) or PH-trees. Back than I implemented a framework for comparing spatial indexes. It even has importers for OpenStreetMap files. Some benchmark results can be found here.TilmannZ– TilmannZ2022-02-13 21:54:35 +00:00Commented Feb 13, 2022 at 21:54
-
@TilmannZ, Thank you for the source code. If you have any documentation or some tutorial on this work, could you please share it? If I am going to use this work, I will definitely give credit to your work.Aavash Bhandari– Aavash Bhandari2022-02-14 04:11:39 +00:00Commented Feb 14, 2022 at 4:11
-
There are javadoc comments in the main classes: PointIndex and RectangleIndex. You can also look at the JUnit tests for examples.TilmannZ– TilmannZ2022-02-14 10:25:47 +00:00Commented Feb 14, 2022 at 10:25
Add a comment
|