Tile start with header (code) of 264 bytes. The definition of body(code) are a bunch of arrays.
�Serialize valhalla tiles just copy arrays in the memory to file handler, which makes deserialize tile is very simple and efficient when use mmap. (code)
All tile data be wrapped in one tar package, there is no compression.
For configuration, passing path of valhalla_tiles.tar as "tile_extract", which is defined in valhalla.json.
Valhalla use mmap to load entire package, collect handler of each files, then build a mapping between tileid <-> file handler. When access tile content, data will be directly convert from pointer of file to pointer of array.
For the api's definition, please go to here
For logic, you could find code here