[python] Added srtm stage.

This commit is contained in:
Maksim Andrianov 2019-06-15 17:50:39 +03:00 committed by gmoryes
parent 86e540688e
commit 0fae3806b8
8 changed files with 30 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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 = {}

View file

@ -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,

View file

@ -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,

View file

@ -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)

View file

@ -154,6 +154,11 @@ def stage_popularity(env, country, **kwargs):
maps_stages.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)

View file

@ -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