Issue #24: fix script command.

This commit is contained in:
Sergey Vartanov 2021-06-20 14:32:25 +03:00
parent 079a04afdf
commit 42040c8082
2 changed files with 5 additions and 2 deletions

View file

@ -71,7 +71,7 @@ If tag is drawable it is displayed using icon combination and colors. All icons
Feel free to request new icons via issues for whatever you want to see on the map. No matter how frequently the tag is used in OpenStreetMap since final goal is to cover all tags. However, common used tags have priority, other things being equal.
Generate icon grid and individual icons with `python roentgen.py icons`. It will create `icon_grid.svg` file, and SVG files in `icon_set/ids` directory where files are named using shape identifiers (e.g. `power_tower_portal_2_level.svg`) and in `icon_set/names` directory where files are named using shape names (e.g. `Röntgen portal two-level transmission tower.svg`). Files from the last directory are used in OpenStreetMap wiki (e.g. [`File:R%C3%B6ntgen_portal_two-level_transmission_tower.svg`](https://wiki.openstreetmap.org/wiki/File:R%C3%B6ntgen_portal_two-level_transmission_tower.svg)).
Generate icon grid and individual icons with `python roentgen.py icons`. It will create `icon_grid.svg` file, and SVG files in `icon_set/ids` directory where files are named using shape identifiers (e.g. `power_tower_portal_2_level.svg`) and in `icon_set/names` directory where files are named using shape names (e.g. `Röntgen portal two-level transmission tower.svg`). Files from the last directory are used in OpenStreetMap wiki (e.g. [`File:Röntgen_portal_two-level_transmission_tower.svg`](https://wiki.openstreetmap.org/wiki/File:R%C3%B6ntgen_portal_two-level_transmission_tower.svg)).
### Icon combination ###

View file

@ -165,13 +165,16 @@ def draw_icons() -> None:
individual SVG files.
"""
os.makedirs("icon_set", exist_ok=True)
os.makedirs("icon_set/ids", exist_ok=True)
os.makedirs("icon_set/names", exist_ok=True)
scheme: Scheme = Scheme(Path("scheme/default.yml"))
extractor: ShapeExtractor = ShapeExtractor(
Path("icons/icons.svg"), Path("icons/config.json")
)
collection: IconCollection = IconCollection.from_scheme(scheme, extractor)
collection.draw_grid(Path("icon_grid.svg"))
collection.draw_icons(Path("icon_set"))
collection.draw_icons(Path("icon_set/ids"))
collection.draw_icons(Path("icon_set/names"), by_name=True)
if __name__ == "__main__":