From 692aa28455a516344265be2c81b8225fbf07a925 Mon Sep 17 00:00:00 2001 From: merspieler Date: Sat, 23 Mar 2019 07:09:20 +0000 Subject: [PATCH] Added first error handling and move of pole files Signed-off-by: merspieler --- scripts/split-world.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/split-world.py b/scripts/split-world.py index 744ed33..fc947c8 100755 --- a/scripts/split-world.py +++ b/scripts/split-world.py @@ -9,13 +9,17 @@ state4 = ['nw', 'ne', 'sw', 'se'] state2 = ['s', 'n'] def run_cut(path, step, name, start_file=None): - print("Building: " + name + "...") if start_file != None: - os.system("osmium extract -c " + path + name + ".json " + start_file + " --overwrite") + print("Splitting world in 4..." + ret = os.system("osmium extract -c " + path + name + ".json " + start_file + " --overwrite") + if ret == 0: + os.system("mv n-pole.osm.pbf output/") + os.system("mv s-pole.osm.pbf output/") else: + print("Building: " + name + "...") os.system("osmium extract -c " + path + str(step) + "-" + name + ".json " + name + ".osm.pbf --overwrite") -run_cut(config_path + prefix, "1", world_file) +run_cut(config_path + prefix, 1, "", world_file) con_pre = config_path + prefix for i in range(0, len(state4)): run_cut(con_pre, 2, state4[i])