I am looking for a storage to index points in 2 dimensions. To be more specific, I would like to store the geometry of ways (or edges) in OpenStreetMap and have it searchable. Queries to the storage would be looking up geometry based on two endpoints of a way. This query would be run to reconstruct the geometry of a path found by an algorithm similar to Dijkstra, so the speed of geometry lookup is important.
Nodes in my case are just unsigned ints and geometry can be encoded as a string or as a vector of points, either way would work.
The number of nodes would be around 1 billion so keeping everything in memory does not work, so it would be nice to find an external or disk based storage.
I have already tried Stxxl but it doesn't seem to support non-POD types like string or vectors as values.
Thanks for suggestions in advance