GIScience / openrouteservice

🌍 The open source route planner api with plenty of features.
https://openrouteservice.org
GNU General Public License v3.0
1.33k stars 379 forks source link

Overhaul country borders storage format #1760

Open aoles opened 3 months ago

aoles commented 3 months ago

Problem description

Current country borders storage holds for each edge an entry consisting of a pair of country IDs at its ends, plus the type of border.

Proposed solution

The storage size could be greatly reduced (by a factor of at least three) by switching from an edge-based to a node-based encoding such that only a single country ID is stored for each node. Border crossings could be then resolved on the fly in the edge filter by comparing the country entries at its ends. In case of a border its openness could be queried from a precomputed map.