valhalla / docker

docker
MIT License
17 stars 22 forks source link

what is the difference between tile_dir and tile_extract in the config #34

Open stvno opened 6 years ago

stvno commented 6 years ago

I'm trying to get the opentraffic servers running again and run into troubles getting the services to run at all. In the end I discovered that the planet_YYYY_MM_DD-HH_MM_SS file & directory weren't created by the scheduled task which calls scripts/cut_tile.sh

Diving into the entire infrastructure I discovered that the valhalla config json contains:

    "tile_dir": "/data/valhalla/tiles",
    "tile_extract": "/data/valhalla/tiles.tar",

so it seems like it expects a tiles.tar file, but the script doesn't generate that. I've stepped through the script manually and once I got a /tiles directory I created the tar file, restarted the process and now at least the various servers boot again, but the routing results show gaps which shouldn't be there.

I'm wondering why you need both settings

kevinkreiser commented 6 years ago

You dont need both settings. But its convenient to have them. Basically what we do is we have a config generation tool which is self documenting. The way it achieves the self-documentation is that it provides default values for all the config parameters (even the optional ones). Hence both are present in the generated config. Now there is a further distinction.

We use the config both for running the route server but also for generating routing tiles. For the former we prefer the extract (ie tar) over the dir of tiles because its more performant. For the latter though, we need the tile_dir.

I'd have to check to through the code to be 100% sure but I do think there are some cases where even though you are using the tile_extract the code will expect the tile_dir to be populated. This is just a result of the fact that we had the dir first and added the extract capability later.