mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 13:03:36 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
55
tools/python/maps_generator/maps_generator.py
Normal file
55
tools/python/maps_generator/maps_generator.py
Normal file
@@ -0,0 +1,55 @@
|
||||
import logging
|
||||
from typing import AnyStr
|
||||
from typing import Iterable
|
||||
from typing import Optional
|
||||
|
||||
from maps_generator.generator import stages_declaration as sd
|
||||
from maps_generator.generator.env import Env
|
||||
from maps_generator.generator.generation import Generation
|
||||
from .generator.stages import Stage
|
||||
|
||||
logger = logging.getLogger("maps_generator")
|
||||
|
||||
|
||||
def run_generation(
|
||||
env: Env,
|
||||
stages: Iterable[Stage],
|
||||
from_stage: Optional[AnyStr] = None,
|
||||
build_lock: bool = True,
|
||||
):
|
||||
generation = Generation(env, build_lock)
|
||||
for s in stages:
|
||||
generation.add_stage(s)
|
||||
|
||||
generation.run(from_stage)
|
||||
|
||||
|
||||
def generate_maps(env: Env, from_stage: Optional[AnyStr] = None):
|
||||
""""Runs maps generation."""
|
||||
stages = (
|
||||
sd.StageDownloadAndConvertPlanet(),
|
||||
sd.StageUpdatePlanet(),
|
||||
sd.StageCoastline(),
|
||||
sd.StagePreprocess(),
|
||||
sd.StageFeatures(),
|
||||
sd.StageDownloadDescriptions(),
|
||||
sd.StageMwm(),
|
||||
sd.StageCountriesTxt(),
|
||||
sd.StageLocalAds(),
|
||||
sd.StageStatistics(),
|
||||
sd.StageCleanup(),
|
||||
)
|
||||
|
||||
run_generation(env, stages, from_stage)
|
||||
|
||||
|
||||
def generate_coasts(env: Env, from_stage: Optional[AnyStr] = None):
|
||||
"""Runs coasts generation."""
|
||||
stages = (
|
||||
sd.StageDownloadAndConvertPlanet(),
|
||||
sd.StageUpdatePlanet(),
|
||||
sd.StageCoastline(use_old_if_fail=False),
|
||||
sd.StageCleanup(),
|
||||
)
|
||||
|
||||
run_generation(env, stages, from_stage)
|
||||
Reference in New Issue
Block a user