organicmaps / organicmaps

🍃 Organic Maps is a free Android & iOS offline maps app for travelers, tourists, hikers, and cyclists. It uses crowd-sourced OpenStreetMap data and is developed with love by MapsWithMe (MapsMe) founders and our community. No ads, no tracking, no data collection, no crapware. Please donate to support the development!
https://organicmaps.app
Apache License 2.0
9.55k stars 919 forks source link

The router loads the most detailed geometry of roads network #2889

Open pastk opened 2 years ago

pastk commented 2 years ago

Does it really need BEST_GEOMETRY to do its job? Maybe WORST_GEOMETRY will be enough? It'll be much less data to read and lighter on memory.

It seems to be the case whether the route is short (and displayed at high zoom) or very long (and displayed at the world map zoom).

To see the evidence add line geometry load logging into feature.cpp::ParseGeometry(int scale) and log the scale. scale == -1 is for BEST_GEOMETRY.

pastk commented 2 years ago

Even for a short route between adjacent villages it could be 200-400 line features loaded, so its not a final built route for sure, probably all analyzed roads are being loaded in BEST_GEOMETRY.

On a longer ~100km route there were ~6k feature loads and some features are re-loaded several times (I found one occurrence of a single line feature being re-loaded 24 times!). Reducing size of loaded data should make the cache much more efficient.

vng commented 2 years ago

Well, we have routing index based on "natural" (best) geometry only. Algo should calculate honest weights (distances).