LocationIndex purpose and index file customisation

I am trying to understand what does the Location Index purpose is and I have some difficulties. I understood that is the representation of a QuadTree where all the leaves are on the same depth but I don’t really understand what is the purpose of the values that are stored in the array inside the leaves. Firstly I thought that there are the nodes inside a certain area located but when running the debugger in the import I’ve found a lot of leaves containing the same node ID. I have uploaded a picture with a tree subranch where all the leaves contains the same array with a single identical value. So my question is what is the purpose of that value and what it represents when the index file is imported back.

Yes, these are the node IDs: https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/storage/index/LocationIndexTree.java#L849

And for every “cell” of the LocationIndex we set one of the nodeIds of the neighboring edges. We probably should better use the edgeId, but it would be still required to duplicate the edgeId for several cells as an edge has an extent and also because of the following limitation of the bresenham algorithm: https://stackoverflow.com/questions/24679963/precise-subpixel-line-drawing-algorithm-rasterization-algorithm

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.