Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(valhalla): increase isochrone limits in valhalla config #77

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## x.y.z

## 2.2.5

CHANGED:
- Valhalla build config: increase default isochrone limits

## 2.2.4

CHANGED:
Expand Down
2 changes: 1 addition & 1 deletion r2gg/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
__uri_tracker__ = f"{__uri_repository__}issues/"
__uri__ = __uri_repository__

__version__ = "2.2.4"
__version__ = "2.2.5"
__version_info__ = tuple(
[
int(num) if num.isdigit() else num
Expand Down
12 changes: 8 additions & 4 deletions r2gg/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,20 @@ def valhalla_convert(config, resource, logger, build_lua_from_cost_config = True
start_command = time.time()
valhalla_build_config_args = ["valhalla_build_config",
"--mjolnir-tile-dir", source["storage"]["dir"],
"--mjolnir-tile-extract", source["storage"]["tar"]]
"--mjolnir-tile-extract", source["storage"]["tar"],
# Modification des limites par défaut du service : 10h pour isochrone et 1000km pour iso distance
# contre 2h et 200km par défaut
"--service-limits-isochrone-max-time-contour", "600",
"--service-limits-isochrone-max-distance-contour", "1000",
# Ajout de l'autorisation à exclure les ponts/tunnels/péages
"--service-limits-allow-hard-exclusions", "True"]
subprocess_execution(valhalla_build_config_args, logger, outfile = source["storage"]["config"])
# Nécessaire le temps que le fichier s'écrive...
time.sleep(1)
# Ajout du graph custom dans la config valhalla
# Ajout du graph custom dans la config valhalla (impossible via les paramètres du build_config)
with open(source["storage"]["config"], "r") as valhalla_config:
config_dict = json.load(valhalla_config)
config_dict["mjolnir"]["graph_lua_name"] = source["costs"][0]["compute"]["storage"]["file"]
# Ajout de l'autorisation à exclure les ponts/tunnels/péages
config_dict["service_limits"]["allow_hard_exclusions"] = True

with open(source["storage"]["config"], "w") as valhalla_config:
valhalla_config.write(json.dumps(config_dict))
Expand Down
Loading