From 1e31f4c8c03be496cb67fcc37235c2f15dd48c78 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Thu, 28 Apr 2022 12:05:21 +0300 Subject: [PATCH] [generator] Do not copy local planet.o5m dump, but make a symlink instead Signed-off-by: Viktor Govako Signed-off-by: Konstantin Pastbin --- tools/python/maps_generator/generator/steps.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/python/maps_generator/generator/steps.py b/tools/python/maps_generator/generator/steps.py index 77dafd8e0d..ae645a0858 100644 --- a/tools/python/maps_generator/generator/steps.py +++ b/tools/python/maps_generator/generator/steps.py @@ -53,6 +53,12 @@ def convert_planet( def step_download_and_convert_planet(env: Env, force_download: bool, **kwargs): + # Do not copy, convert, check a local .o5m planet dump, just symlink it instead. + src = settings.PLANET_URL + if src.startswith("file://") and src.endswith(".o5m"): + os.symlink(src[7:], env.paths.planet_o5m) + return + if force_download or not is_verified(env.paths.planet_osm_pbf): download_files( { @@ -72,6 +78,7 @@ def step_download_and_convert_planet(env: Env, force_download: bool, **kwargs): output=env.get_subprocess_out(), error=env.get_subprocess_out(), ) + os.remove(env.paths.planet_osm_pbf) os.remove(md5_ext(env.paths.planet_osm_pbf))