[PATCH] QuadBuckets for Way storage
|Reported by:||Dave Hansen <dave@…>||Owned by:||team|
Well, here's the patch to make QuadBuckets store 2-d objects and not just nodes.
A bounding box is created for each way representing the minimum and maximum Latitude and Longitude that each way touches. If a way's bounding box crosses more than one quadrant at a node in the table then the way is stored in that node. This means that there can now be contents stored in the tree in its branches and not just in leaves. The worst possible case here is that every way in the data set crosses the same two quads and all of them end up getting stored in one huge branch node.
Objects which have no location information, such as nodes that return null for node.getCoor() are stored in the root branch node.
When doing a search, you start at the root node and walk down the tree. But, you must now check each branch on the way down to the leaves to see if any objects in the branch match your search.