Skip to content

Latest commit

 

History

History
25 lines (13 loc) · 1.79 KB

valhalla-tile-read-logic.md

File metadata and controls

25 lines (13 loc) · 1.79 KB

Valhalla LoadTile logic

Tile Definition

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)

TileReaderInit

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.

single_cell

GetTile

For the api's definition, please go to here

For logic, you could find code here

single_cell