diff options
author | Maksim Andrianov <maksimandrianov1@gmail.com> | 2019-06-15 17:50:39 +0300 |
---|---|---|
committer | gmoryes <gmoryes@gmail.com> | 2019-06-17 13:35:30 +0300 |
commit | 0fae3806b843a4ff87b18bf259c7bd0d52e3f85d (patch) | |
tree | a80ec64ad4a7eadd70c2ede2bdd6b99b44fe1bcc /tools | |
parent | 86e540688ecaeee12dba930b71cf1f4848b2d751 (diff) |
[python] Added srtm stage.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/maps_generator/README.md | 1 | ||||
-rw-r--r-- | tools/python/maps_generator/__main__.py | 3 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/env.py | 2 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/gen_tool.py | 1 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/maps_stages.py | 15 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/settings.py | 2 | ||||
-rw-r--r-- | tools/python/maps_generator/maps_generator.py | 6 | ||||
-rw-r--r-- | tools/python/maps_generator/var/etc/map_generator.ini.default | 1 |
8 files changed, 30 insertions, 1 deletions
diff --git a/tools/python/maps_generator/README.md b/tools/python/maps_generator/README.md index a4b78b0a9a..4ad2c7552d 100644 --- a/tools/python/maps_generator/README.md +++ b/tools/python/maps_generator/README.md @@ -79,6 +79,7 @@ OSM_TOOLS_PATH: ~/osmctools # POPULARITY_URL: # FOOD_URL: # FOOD_TRANSLATIONS_URL: +# SRTM_PATH: [Stats] # Path to rules for calculating statistics by type diff --git a/tools/python/maps_generator/__main__.py b/tools/python/maps_generator/__main__.py index 39f59692d5..d8049fe1c7 100644 --- a/tools/python/maps_generator/__main__.py +++ b/tools/python/maps_generator/__main__.py @@ -8,7 +8,7 @@ from .generator.exceptions import ContinueError, SkipError, ValidationError from .maps_generator import (generate_maps, generate_coasts, reset_to_stage, ALL_STAGES, stage_download_production_external, stage_descriptions, stage_ugc, stage_popularity, - stage_localads, stage_statistics, + stage_localads, stage_statistics, stage_srtm, stages_as_string) from .utils.collections import unique @@ -168,6 +168,7 @@ def main(): stage_download_production_external, stage_ugc, stage_popularity, + stage_srtm, stage_descriptions, stage_localads, stage_statistics diff --git a/tools/python/maps_generator/generator/env.py b/tools/python/maps_generator/generator/env.py index 1a1fdc2414..8a86f3a360 100644 --- a/tools/python/maps_generator/generator/env.py +++ b/tools/python/maps_generator/generator/env.py @@ -120,6 +120,8 @@ class Env: self.coastline_tmp_path = os.path.join(self.coastline_path, "tmp") self._create_if_not_exist(self.coastline_tmp_path) + self.srtm_path = settings.SRTM_PATH + self._subprocess_out = None self._subprocess_countries_out = {} diff --git a/tools/python/maps_generator/generator/gen_tool.py b/tools/python/maps_generator/generator/gen_tool.py index 440f10dd43..48361fdb9a 100644 --- a/tools/python/maps_generator/generator/gen_tool.py +++ b/tools/python/maps_generator/generator/gen_tool.py @@ -62,6 +62,7 @@ class GenTool: "regions_features": str, "regions_index": str, "regions_key_value": str, + "srtm_path": str, "transit_path": str, "ugc_data": str, "user_resource_path": str, diff --git a/tools/python/maps_generator/generator/maps_stages.py b/tools/python/maps_generator/generator/maps_stages.py index 01fcb2769a..c7e5e21137 100644 --- a/tools/python/maps_generator/generator/maps_stages.py +++ b/tools/python/maps_generator/generator/maps_stages.py @@ -94,6 +94,21 @@ def stage_popularity(env, country, **kwargs): ) +def stage_srtm(env, country, **kwargs): + run_gen_tool_with_recovery_country( + env, + env.gen_tool, + out=env.get_subprocess_out(country), + err=env.get_subprocess_out(country), + data_path=env.mwm_path, + intermediate_data_path=env.intermediate_path, + user_resource_path=env.user_resource_path, + srtm_path=env.srtm_path, + output=country, + **kwargs + ) + + def stage_routing(env, country, **kwargs): run_gen_tool_with_recovery_country( env, diff --git a/tools/python/maps_generator/generator/settings.py b/tools/python/maps_generator/generator/settings.py index eb387b961d..5ac8204ad7 100644 --- a/tools/python/maps_generator/generator/settings.py +++ b/tools/python/maps_generator/generator/settings.py @@ -50,6 +50,7 @@ POPULARITY_URL= "" SUBWAY_URL = "" FOOD_URL = "" FOOD_TRANSLATIONS_URL = "" +SRTM_PATH = "" STATS_TYPES_CONFIG = "" @@ -123,6 +124,7 @@ SUBWAY_URL = _get_opt(config, "External", "SUBWAY_URL", SUBWAY_URL) FOOD_URL = _get_opt(config, "External", "FOOD_URL", FOOD_URL) FOOD_TRANSLATIONS_URL = _get_opt(config, "External", "FOOD_TRANSLATIONS_URL", FOOD_TRANSLATIONS_URL) +SRTM_PATH = _get_opt_path(config, "External", "SRTM_PATH", SRTM_PATH) STATS_TYPES_CONFIG = _get_opt_path(config, "Stats", "STATS_TYPES_CONFIG", STATS_TYPES_CONFIG) diff --git a/tools/python/maps_generator/maps_generator.py b/tools/python/maps_generator/maps_generator.py index 9bb8bab254..50673a87a6 100644 --- a/tools/python/maps_generator/maps_generator.py +++ b/tools/python/maps_generator/maps_generator.py @@ -155,6 +155,11 @@ def stage_popularity(env, country, **kwargs): @country_stage +def stage_srtm(env, country, **kwargs): + maps_stages.stage_srtm(env, country, **kwargs) + + +@country_stage def stage_routing(env, country, **kwargs): maps_stages.stage_routing(env, country, **kwargs) @@ -170,6 +175,7 @@ def stage_mwm(env): stage_index(env, country) stage_ugc(env, country) stage_popularity(env, country) + stage_srtm(env, country) stage_routing(env, country) stage_routing_transit(env, country) env.finish_mwm(country) diff --git a/tools/python/maps_generator/var/etc/map_generator.ini.default b/tools/python/maps_generator/var/etc/map_generator.ini.default index d2c5a00439..9f03f7f83c 100644 --- a/tools/python/maps_generator/var/etc/map_generator.ini.default +++ b/tools/python/maps_generator/var/etc/map_generator.ini.default @@ -34,6 +34,7 @@ OSM_TOOLS_PATH: ~/osmctools # SUBWAY_URL: # FOOD_URL: # FOOD_TRANSLATIONS_URL: +# SRTM_PATH: [Stats] STATS_TYPES_CONFIG: ${Developer:OMIM_PATH}/tools/python/maps_generator/var/etc/stats_types_config.txt |