Closed azhi closed 3 years ago
Puuh, good question! That's been done by one of our past colleagues and I never really bothered to fully understand that logic.. Did you test a few cases (with & without forcing rebuild) with your changes and it now behaves properly? Then I'd trust it enough to just merge it.
Nope, didn't check other cases. I'm trying to check my own case right now to confirm fix at least works there. If you have a list of cases you want me to check I can run a few builds.
That'd be cool, thanks! (redundant, not sure right now what to test there..) Just tried looking into it, that script needs some decrypting reaaally bad! I'll try your PR myself one of the next days and maybe even come up with smth less cryptic. Hope you can make it work for yourself until then!
UPD: can confirm my fix doesn't work either :).
TEST: /custom_files
Valid valhalla_tiles.tar found with use_tiles_ignore_pbf: !
Build new valhalla_tiles.tar from available PBF(s).
6d83e2e04b33e2ee3d2297803680e225637f79cf6adcbf2eb727b6a326641df3
Found valid hash for /custom_files/arkansas-latest.osm.pbf!
Scanning old hash 6d83e2e04b33e2ee3d2297803680e225637f79cf6adcbf2eb727b6a326641df3
Either valhalla_tiles.tar couldn't be found or new files or file constellations were detected. Rebuilding files: /custom_files/arkansas-latest.osm.pbf
PBF hashes: 1
PBF file Counter: 1
=========================================================================
= No valid bounding box or elevation parameter set. Skipping elevation! =
=========================================================================
==========================
= Skipping admin regions =
==========================
==========================
= Skipping timezone data =
==========================
==========================
= Using existing config file =
==========================
=========================
= Build the tile files. =
=========================
Running build tiles with: /custom_files/valhalla.json /custom_files/arkansas-latest.osm.pbf
2021/01/12 15:44:59.591490 [INFO] Start stage = initialize End stage = cleanup
2021/01/12 15:44:59.593129 [INFO] Parsing files for ways: /custom_files/arkansas-latest.osm.pbf
2021/01/12 15:44:59.593230 [INFO] Parsing ways...
PBF hashes: 1
PBF file Counter: 1
, but it still decides to rebuild.
I'll close PR in that case.
can you try use_tiles_ignore_pbf=True in the docker-compose?
I actually always do that with existing valhalla_tiles.tar and didn't have a problem so far when using that env var.. but yeah, can't say how it behaves when it's not set
Yeah, already tried use_tiles_ignore_pbf
, it works, thanks.
Was just playing with my fix to see if it worked :).
Ok great! I'll leave this open as a reminder to finally clean up a little:)
took ages, but I finally had some time to clean up and this works now too!
I'm having trouble starting valhalla without rebuild.
Log from first start that builds everything:
Build log
As you can see, it created a tar file and added hash of
/custom_files/california-latest.osm.pbf
.Log on second start
It looks like it decides to build the files because:
, and
0 != 1
.PBF hashes (result of
hash_counter()
) is 0 because it starts counting from-1
.Unless I'm missing something, it really should start counting from 0. I'll make a PR if that's the case.