You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a branch where delta encoding for the geometry is used. This saves over 30% of the space for the geometry file which is about 10% overall savings. E.g. for world wide this saving is over 1GB.
It also seems to be slightly faster for routing (but this might be due to less RAM usage). But the location lookup is slightly slower (acceptable. probably only a tiny fraction of whole routing as now that dynamic lookup is implemented).
The only real problem is now how many bytes we need to read from the DataAccess object in order to safely read all geometry. Currently we create a small byte array and read the number of entries (points with two double values), then we create a new large byte array with num*dimension*6. And although this is very optimistic (one entry fits typically into 4 bytes due to delta encoding) but could fail in extreme cases where the points are too far away like it is in our test cases and we need to increase to 6 bytes per dimension but even 9 bytes are possible per value.
The best way would be to extend the DataAccess and implement the readXY methods directly there so that one avoids to allocate an array.
For now just accept the slightly more disk and memory usage as we can increase the 4 bytes of the georef to 5 with #2993. (And if memory is rare we could force this geometry-DataAccess to type MMap instead of the default)
Activity
karussell commentedon Sep 29, 2019
Another idea is to use the encoded polyline algorithm. Here is a branch for this: https://github.com/graphhopper/graphhopper/commits/improve_waygeometry (also slower but nicely compact)
karussell commentedon Apr 30, 2024
For now just accept the slightly more disk and memory usage as we can increase the 4 bytes of the georef to 5 with #2993. (And if memory is rare we could force this geometry-DataAccess to type MMap instead of the default)