diff options
author | Maksim Andrianov <maksimandrianov1@gmail.com> | 2019-05-21 17:32:17 +0300 |
---|---|---|
committer | gmoryes <gmoryes@gmail.com> | 2019-05-21 19:20:07 +0300 |
commit | 2c30c4d5b2dd053d443c60634820e35d11017dff (patch) | |
tree | f1769648cac068400f736e6b947ba9499f24674f /tools | |
parent | d6cb04665808995461f8209f442355b257a3e0fb (diff) |
Review fixes.
#Review fixes.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/maps_generator/README.md | 11 | ||||
-rw-r--r-- | tools/python/maps_generator/__main__.py | 6 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/settings.py | 4 | ||||
-rw-r--r-- | tools/python/maps_generator/maps_generator.py | 2 |
4 files changed, 13 insertions, 10 deletions
diff --git a/tools/python/maps_generator/README.md b/tools/python/maps_generator/README.md index 6d5919bceb..5571491a86 100644 --- a/tools/python/maps_generator/README.md +++ b/tools/python/maps_generator/README.md @@ -63,8 +63,11 @@ OSM_TOOLS_PATH: ~/osmctools # PLANET_URL: # The url to the file with md5 sum of the planet. # PLANET_MD5_URL: -# The url to WorldCoasts.geom and WorldCoasts.rawgeom(without file name). -# You can write file:///path/to/coasts/. Files latest.geom and latest.rawgeom must be on this URL. +# The base url to WorldCoasts.geom and WorldCoasts.rawgeom (without file name). +# Files latest_coasts.geom and latest_coasts.rawgeom must be at this URL. +# For example, if PLANET_COASTS_URL = https://somesite.com/download/ +# The https://somesite.com/download/latest_coasts.geom url will be used to download latest_coasts.geom and +# the https://somesite.com/download/latest_coasts.rawgeom url will be used to download latest_coasts.rawgeom. # PLANET_COASTS_URL: # The url to the subway file. # SUBWAY_URL: @@ -78,7 +81,7 @@ OSM_TOOLS_PATH: ~/osmctools ``` -##### Node: In each field in which you need to specify a URL, you can specify the path to the file system using file://path/to/file +##### Note: In each field where you need to specify a URL, you can specify the path to the file system using file:///path/to/file ## Usage ```sh @@ -121,7 +124,7 @@ optional arguments: preprocess, features, mwm, descriptions, countries_txt, cleanup, index, ugc, popularity, routing, routing_transit. - --only_coasts Build WorldCoasts.raw and WorldCoasts.rawgeom files + --coasts Build WorldCoasts.raw and WorldCoasts.rawgeom files --production Build production maps. In another case, 'osm only maps' are built - maps without additional data and advertising. diff --git a/tools/python/maps_generator/__main__.py b/tools/python/maps_generator/__main__.py index a7161f5c44..6053b7135d 100644 --- a/tools/python/maps_generator/__main__.py +++ b/tools/python/maps_generator/__main__.py @@ -49,10 +49,10 @@ def parse_options(): help=f"Stage from which maps will be rebuild. Available stages: " f"{', '.join([s.replace('stage_', '') for s in ALL_STAGES])}.") parser.add_argument( - "--only_coasts", + "--coasts", default=False, action="store_true", - help="Build WorldCoasts.raw and WorldCoasts.rawgeom files") + help="Build WorldCoasts.raw and WorldCoasts.rawgeom files") parser.add_argument( "--production", default=False, @@ -141,7 +141,7 @@ def main(): env = Env(options) if env.from_stage: reset_to_stage(env.from_stage, env) - if env.only_coasts: + if env.coasts: generate_coasts(env) else: generate_maps(env) diff --git a/tools/python/maps_generator/generator/settings.py b/tools/python/maps_generator/generator/settings.py index 9d671b6bbf..b0adebe3cd 100644 --- a/tools/python/maps_generator/generator/settings.py +++ b/tools/python/maps_generator/generator/settings.py @@ -122,8 +122,8 @@ FOOD_TRANSLATIONS_URL = _get_opt(config, "External", "FOOD_TRANSLATIONS_URL", PLANET_O5M = os.path.join(MAIN_OUT_PATH, PLANET + ".o5m") PLANET_PBF = os.path.join(MAIN_OUT_PATH, PLANET + ".osm.pbf") -PLANET_COASTS_GEOM_URL = os.path.join(PLANET_COASTS_URL, "latest.geom") -PLANET_COASTS_RAWGEOM_URL = os.path.join(PLANET_COASTS_URL, "latest.rawgeom") +PLANET_COASTS_GEOM_URL = os.path.join(PLANET_COASTS_URL, "latest_coasts.geom") +PLANET_COASTS_RAWGEOM_URL = os.path.join(PLANET_COASTS_URL, "latest_coasts.rawgeom") if DEBUG: PLANET_URL = "http://osmz.ru/mwm/islands/islands.o5m" diff --git a/tools/python/maps_generator/maps_generator.py b/tools/python/maps_generator/maps_generator.py index 7347df17cd..4293d7fc78 100644 --- a/tools/python/maps_generator/maps_generator.py +++ b/tools/python/maps_generator/maps_generator.py @@ -106,7 +106,6 @@ def stage_coastline(env): coasts_geom = "WorldCoasts.geom" coasts_rawgeom = "WorldCoasts.rawgeom" try: - raise BadExitStatusError() coastline.make_coastline(env) except BadExitStatusError: logger.info("Build costs failed. Try to download the costs...") @@ -314,6 +313,7 @@ def generate_maps(env): def generate_coasts(env): with FileLock(planet_lock_file(), timeout=1) as planet_lock: + stage_download_and_convert_planet(env) stage_update_planet(env) with FileLock(build_lock_file(env.out_path), timeout=1): stage_coastline(env) |