itinero / routing2

The next version of the Itinero route planner.
Apache License 2.0
7 stars 1 forks source link

Improve graphtile internal storage #8

Open xivk opened 4 years ago

xivk commented 4 years ago

Basic principles

There are some improvements possible in graph tile storage. We make the distinctions between:

The focus should be on getting storing the routing data as efficiently as possible. The meta data has to be accessible but doesn't not have to be available immediately when accessing an edge.

Current structure

The vertices have the following data:

The current graph edges has the following data:

Improvements

Ideal would be to have a data structure where we have vertexids and edgeids that increase by one each time a vertex or edges is added. These IDs remain constant even when changing some of the edge payloads.

The new structure could be

Routing data

One byte array with vertex routing data:

One edge array with edge routing data:

Meta data

Now that we have one-increasing ids that won't change we can store all meta-data using those ids. We store the edge attributes identified by edge id, the same for the shapes, turn restrictions and vertex attributes.