forked from organicmaps/organicmaps
[python][generator] Added mwm generation order support.
This commit is contained in:
parent
48189981d1
commit
af0c5a68db
2 changed files with 1169 additions and 0 deletions
|
@ -92,6 +92,11 @@ def parse_options():
|
|||
action="store_true",
|
||||
help="Build production maps. In another case, 'osm only maps' are built"
|
||||
" - maps without additional data and advertising.")
|
||||
parser.add_argument(
|
||||
"--order",
|
||||
type=str,
|
||||
default="",
|
||||
help="Mwm generation order.")
|
||||
return vars(parser.parse_args())
|
||||
|
||||
|
||||
|
@ -156,6 +161,20 @@ def main():
|
|||
raise ValidationError(f"Bad input countries {', '.join(diff)}")
|
||||
options["countries"] = countries if countries else all_countries
|
||||
|
||||
if options["order"]:
|
||||
ordered_countries = []
|
||||
countries = set(options["countries"])
|
||||
with open(options["order"]) as file:
|
||||
for c in file:
|
||||
c = c.strip()
|
||||
if c in countries:
|
||||
ordered_countries.append(c)
|
||||
countries.remove(c)
|
||||
if countries:
|
||||
raise ValueError(f"{options['order']} does not have an order "
|
||||
f"for {countries}.")
|
||||
options["countries"] = ordered_countries
|
||||
|
||||
options_skip = []
|
||||
if options["skip"]:
|
||||
options_skip = [
|
||||
|
|
1150
tools/python/maps_generator/var/etc/mwm_generation_order.txt
Normal file
1150
tools/python/maps_generator/var/etc/mwm_generation_order.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue