Review fixes

This commit is contained in:
Maksim Andrianov 2019-06-24 18:14:06 +03:00 committed by gmoryes
parent 195d9109a8
commit bdf31f92aa
6 changed files with 1174 additions and 1160 deletions

View file

@ -121,8 +121,8 @@ optional arguments:
download_and_convert_planet, update_planet, coastline,
preprocess, features, mwm, descriptions,
countries_txt, external_resources, localads,
statistics, cleanup, index, ugc, popularity, routing,
routing_transit.
statistics, cleanup, index, ugc, popularity, srtm,
routing, routing_transit.
--from_stage FROM_STAGE
Stage from which maps will be rebuild. Available
stages: download_external,
@ -130,17 +130,27 @@ optional arguments:
download_and_convert_planet, update_planet, coastline,
preprocess, features, mwm, descriptions,
countries_txt, external_resources, localads,
statistics, cleanup, index, ugc, popularity, routing,
routing_transit.
statistics, cleanup, index, ugc, popularity, srtm,
routing, routing_transit.
--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.
--order ORDER Mwm generation order.
```
If you are not from the maps.me team, then you do not need the option --production when generating maps.
To generate maps for the whole world you need 400 GB of hard disk space and a computer with more than 64 GB.
If you want to generate a lot of maps, then it may be important for you to order the generation of maps.
Because different maps take different amounts of time to generate.
Using a list with maps order can reduce build time on a multi-core computer.
The order from: var/etc/mwm_generation_order.txt is used by default.
You can override this behavior with the option --order=/path/to/mwm_generation_order.txt
You can calculate this list yourself from the statistics, which is calculated with each generation.
### Examples
#### Non-standard planet
If you want to generate maps for Japan you must complete the following steps:

View file

@ -95,7 +95,8 @@ def parse_options():
parser.add_argument(
"--order",
type=str,
default="",
default=os.path.join(os.path.dirname(os.path.abspath(__file__)),
"var/etc/file_generation_order.txt"),
help="Mwm generation order.")
return vars(parser.parse_args())
@ -166,7 +167,9 @@ def main():
countries = set(options["countries"])
with open(options["order"]) as file:
for c in file:
c = c.strip()
if c.strip().startswith("#"):
continue
c = c.split("\t")[0].strip()
if c in countries:
ordered_countries.append(c)
countries.remove(c)

View file

@ -140,14 +140,14 @@ class Env:
def get_mwm_names(self):
tmp_ext = ".mwm.tmp"
existed_names = set()
existing_names = set()
for f in os.listdir(self.intermediate_tmp_path):
path = os.path.join(self.intermediate_tmp_path, f)
if f.endswith(tmp_ext) and os.path.isfile(path):
name = f.replace(tmp_ext, "")
if name in self.countries:
existed_names.add(name)
return [c for c in self.countries if c in existed_names]
existing_names.add(name)
return [c for c in self.countries if c in existing_names]
def is_accepted_stage(self, stage_name):
return stage_name not in self._skipped_stages

View file

@ -19,7 +19,7 @@ RE_TIME_DELTA = re.compile(r'^(?:(?P<days>-?\d+) (days?, )?)?'
r'(?P<seconds>-?\d+)'
r'(?:\.(?P<microseconds>\d{1,6})\d{0,6})?$')
RE_FINISH_STAGE = re.compile(r"(.*)Stage ([A-Za-z ]+): finished in (.+)$")
RE_FINISH_STAGE = re.compile(r"(.*)Stage (.+): finished in (.+)$")
def read_stat(f):

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff