Skip to content

Commit a5a658b

Browse files
committed
download-osm fix missing "timestamp max"
During make-dc command, there could be a case when `timestamp max` does not get printed by the osmconvert's statistics output. Handle such case, and simply remove the `OSM_MAX_TIMESTAMP` from the generated docker compose file.
1 parent 90e1a7a commit a5a658b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/download-osm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ def make_docker_compose_file(pbf_file: Path, dc_file: Path,
628628
lon_max = res["lon max"]
629629
lat_min = res["lat min"]
630630
lat_max = res["lat max"]
631-
timestamp_max = res["timestamp max"]
631+
timestamp_max = res["timestamp max"] if "timestamp max" in res else None
632632
env_values = {
633633
"environment": {
634634
"BBOX": f"{lon_min},{lat_min},{lon_max},{lat_max}",
@@ -637,6 +637,9 @@ def make_docker_compose_file(pbf_file: Path, dc_file: Path,
637637
"MIN_ZOOM": min_zoom,
638638
"MAX_ZOOM": max_zoom,
639639
}}
640+
if timestamp_max is None:
641+
# Deleting is better than adding because it keeps key ordering intact
642+
del env_values["environment"]["OSM_MAX_TIMESTAMP"]
640643
dc_data = {
641644
"version": str(dc_ver),
642645
"services": {

0 commit comments

Comments
 (0)