diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 15f37c7..8fb6cff 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,7 +1,7 @@ Contributing ============ -Thank you for your interest in the Röntgen project. Since the primary goal of the project is to cover as many tags as possible, the project is crucially depend on contributions as OpenStreetMap itself. +Thank you for your interest in the Map Machine project. Since the primary goal of the project is to cover as many tags as possible, the project is crucially depend on contributions as OpenStreetMap itself. Suggest a tag to support ------------------------ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 20918ab..0d189d1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: pip install . - name: Check code style with Black run: | - black -l 80 --check roentgen tests + black -l 80 --check map_machine tests - name: Lint with Flake8 run: | flake8 --max-line-length=80 --ignore=E203,W503 @@ -32,16 +32,16 @@ jobs: pytest -v - name: Test render run: | - roentgen render -b 10.000,20.000,10.001,20.001 --cache tests/data + map-machine render -b 10.000,20.000,10.001,20.001 --cache tests/data - name: Test icon generation run: | - roentgen icons + map-machine icons - name: Test MapCSS 0.2 generation run: | - roentgen mapcss + map-machine mapcss - name: Test element generation run: | - roentgen element --node amenity=bench,material=wood + map-machine element --node amenity=bench,material=wood - name: Test tile generation run: | - roentgen tile --coordinates 50.000,40.000 --cache tests/data + map-machine tile --coordinates 50.000,40.000 --cache tests/data diff --git a/README.md b/README.md index acab178..fc01e91 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,27 @@ -**Röntgen** (or **Roentgen** when ASCII is preferred) project consists of +**Map Machine** project consists of * simple Python [OpenStreetMap](http://openstreetmap.org) renderer and tile generator (see [usage](#usage-example), [renderer documentation](#map-generation), [tile generation](#tile-generation)), - * [set of CC-BY 4.0 icons](#icon-set) that can be used outside the project. + * [Röntgen icon set](#icon-set): unique CC-BY 4.0 icons. -The idea behind the Röntgen project is to **show all the richness of the OpenStreetMap data**: to have a possibility to *display any map feature* represented by OpenStreetMap data tags by means of colors, shapes, and icons. Röntgen is created for OpenStreetMap contributors: to display all changes one made on the map even if they are small, and for users: to dig down into the map and find every detail that was mapped. +The idea behind the Map Machine project is to **show all the richness of the OpenStreetMap data**: to have a possibility to *display any map feature* represented by OpenStreetMap data tags by means of colors, shapes, and icons. Map Machine is created for OpenStreetMap contributors: to display all changes one made on the map even if they are small, and for users: to dig down into the map and find every detail that was mapped. -Unlike standard OpenStreetMap layers, **Röntgen is a playground for experiments** where one can easily try to support proposed tags, tags with little or even single usage, deprecated tags. +Unlike standard OpenStreetMap layers, **Map Machine is a playground for experiments** where one can easily try to support proposed tags, tags with little or even single usage, deprecated tags. -Röntgen is intended to be highly configurable, so it can generate precise but messy maps for OSM contributors as well as pretty and clean maps for OSM users, can use slow algorithms for some experimental features. +Map Machine is intended to be highly configurable, so it can generate precise but messy maps for OSM contributors as well as pretty and clean maps for OSM users, can use slow algorithms for some experimental features. Usage example ------------- ```bash -roentgen render -b 2.284,48.860,2.290,48.865 +map-machine render -b 2.284,48.860,2.290,48.865 ``` will automatically download OSM data and write output SVG map of the specified area to `out/map.svg`. See [Map generation](#map-generation). ```bash -roentgen tile -b 2.361,48.871,2.368,48.875 +map-machine tile -b 2.361,48.871,2.368,48.875 ``` will automatically download OSM data and write output PNG tiles that cover the specified area to `out/tiles` directory. See [Tile generation](#tile-generation). @@ -29,7 +29,7 @@ will automatically download OSM data and write output PNG tiles that cover the s Map features ------------ -Röntgen features: +Map Machine features: * detailed icons to display subtypes like [power tower design](#power-tower-design), * can display multiple icons for one entity to cover more features, @@ -77,21 +77,21 @@ There are [special symbols](https://en.wikipedia.org/wiki/List_of_Japanese_map_s Icon set -------- -The central feature of the project is Röntgen icon set. It is a set of monochrome 14 × 14 px pixel-aligned icons. Unlike the Röntgen source code, which is under MIT license, all icons are under [CC BY](http://creativecommons.org/licenses/by/4.0/) license. So, with the appropriate credit icon set can be used outside the project. Some icons can be used as emoji symbols. +The central feature of the project is Röntgen icon set. It is a set of monochrome 14 × 14 px pixel-aligned icons. Unlike the Map Machine source code, which is under MIT license, all icons are under [CC BY](http://creativecommons.org/licenses/by/4.0/) license. So, with the appropriate credit icon set can be used outside the project. Some icons can be used as emoji symbols. All icons tend to support common design style, which is heavily inspired by [Maki](https://github.com/mapbox/maki), [Osmic](https://github.com/gmgeo/osmic), and [Temaki](https://github.com/ideditor/temaki). -Icons are used to visualize tags for nodes and areas. Unlike other renderers, Röntgen can use more than one icon to visualize an entity and use colors to visualize [`colour`](https://wiki.openstreetmap.org/wiki/Key:colour) value or other entity properties (like [`material`](https://wiki.openstreetmap.org/wiki/Key:material) or [`genus`](https://wiki.openstreetmap.org/wiki/Key:genus)). +Icons are used to visualize tags for nodes and areas. Unlike other renderers, Map Machine can use more than one icon to visualize an entity and use colors to visualize [`colour`](https://wiki.openstreetmap.org/wiki/Key:colour) value or other entity properties (like [`material`](https://wiki.openstreetmap.org/wiki/Key:material) or [`genus`](https://wiki.openstreetmap.org/wiki/Key:genus)). ![Icons](doc/grid.png) 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 sets of individual icons with `roentgen icons`. It will create `out/icon_grid.svg` file, and SVG files in `out/icons_by_id` directory where files are named using shape identifiers (e.g. `power_tower_portal_2_level.svg`) and in `icons_by_name` 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)). +Generate icon grid and sets of individual icons with `map-machine icons`. It will create `out/icon_grid.svg` file, and SVG files in `out/icons_by_id` directory where files are named using shape identifiers (e.g. `power_tower_portal_2_level.svg`) and in `icons_by_name` 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)). ### Shape combination ### -Röntgen constructs icons from the shapes extracted from the sketch SVG file. Some icons consists of just one shape, to construct other it may be necessary to combine two or more shapes. +Map Machine constructs icons from the shapes extracted from the sketch SVG file. Some icons consists of just one shape, to construct other it may be necessary to combine two or more shapes. ![Bus stop icon combination](doc/bus_stop.png) @@ -128,7 +128,7 @@ Map generation Command `render` is used to generates SVG map from OpenStreetMap data. You can run it using: ```bash -roentgen render \ +map-machine render \ -b ,,, \ -o \ -z \ @@ -138,7 +138,7 @@ roentgen render \ ### Example ### ```bash -roentgen render \ +map-machine render \ --boundary-box 2.284,48.860,2.290,48.865 \ --output out/esplanade_du_trocadéro.svg ``` @@ -160,7 +160,7 @@ plus [map configuration options](#map-options) Tile generation --------------- -Command `tile` is used to generate PNG tiles for [slippy maps](https://wiki.openstreetmap.org/wiki/Slippy_Map). To use them, run [Röntgen tile server](#tile-server). +Command `tile` is used to generate PNG tiles for [slippy maps](https://wiki.openstreetmap.org/wiki/Slippy_Map). To use them, run [Map Machine tile server](#tile-server). | Option | Description | |---|---| @@ -169,6 +169,7 @@ Command `tile` is used to generate PNG tiles for [slippy maps](https://wiki.open | `--cache` `` | path for temporary OSM files, default value: `cache` | | `-b`, `--boundary-box` `,,,` | construct the minimum amount of tiles that cover requested boundary box | | `-z`, `--zoom` `` | OSM zoom levels; can be list of numbers or ranges, e.g. `16-18`, `16,17,18`, or `16,18-20`, default value: `18` | +| `-i`, `--input` `` | input OSM XML file name (if not specified, file will be downloaded using OpenStreetMap API) | plus [map configuration options](#map-options) @@ -177,13 +178,13 @@ plus [map configuration options](#map-options) Specify tile coordinates: ```bash -roentgen tile --tile // +map-machine tile --tile // ``` or specify any geographical coordinates inside a tile: ```bash -roentgen tile \ +map-machine tile \ --coordinates , \ --zoom ``` @@ -193,7 +194,7 @@ Tile will be stored as SVG file `out/tiles/tile___.svg` and PN Example: ```bash -roentgen tile -c 55.7510637,37.6270761 -z 18 +map-machine tile -c 55.7510637,37.6270761 -z 18 ``` will generate SVG file `out/tiles/tile_18_158471_81953.svg` and PNG file `out/tiles/tile_18_158471_81953.png`. @@ -203,7 +204,7 @@ will generate SVG file `out/tiles/tile_18_158471_81953.svg` and PNG file `out/ti Specify boundary box to get the minimal set of tiles that covers the area: ```bash -roentgen tile \ +map-machine tile \ --boundary-box ,,, \ --zoom ``` @@ -213,7 +214,7 @@ Boundary box will be extended to the boundaries of the minimal tile set that cov Example: ```bash -roentgen tile -b 2.361,48.871,2.368,48.875 +map-machine tile -b 2.361,48.871,2.368,48.875 ``` will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the way to 18/132796/90169 and two cached files `cache/2.360,48.869,2.370,48.877_18.svg` and `cache/2.360,48.869,2.370,48.877_18.png`. @@ -224,7 +225,7 @@ Tile server Command `server` is used to run tile server for slippy maps. ``` -roentgen server +map-machine server ``` Stop server interrupting process with Ctrl + C. @@ -239,13 +240,13 @@ Stop server interrupting process with Ctrl + C. Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19: ```bash -roentgen tile -b 2.364,48.854,2.367,48.857 -z 16-19 +map-machine tile -b 2.364,48.854,2.367,48.857 -z 16-19 ``` Run tile server on 127.0.0.1:8080: ```bash -roentgen server +map-machine server ``` Use JavaScript code for [Leaflet](https://leafletjs.com/): @@ -258,8 +259,8 @@ L.tileLayer('http://127.0.0.1:8080/tiles/{z}/{x}/{y}', { attribution: 'Map data © ' + 'OpenStreetMap ' + 'contributors, imagery © ' + - 'Röntgen', - id: 'roentgen', + 'Map Machine', + id: 'map_machine', tileSize: 256, zoomOffset: 0 }).addTo(map); @@ -288,9 +289,9 @@ Map configuration options used by `render` and `tile` commands: MapCSS 0.2 generation --------------------- -Command `mapcss` is used to generate MapCSS scheme. `roentgen mapcss` will create `out/roentgen_mapcss` directory with simple MapCSS 0.2 scheme adding icons from Röntgen icon set to nodes and areas: `.mapcss` file and directory with icons. +Command `mapcss` is used to generate MapCSS scheme. `map-machine mapcss` will create `out/map_machine_mapcss` directory with simple MapCSS 0.2 scheme adding icons from Röntgen icon set to nodes and areas: `.mapcss` file and directory with icons. -To create MapCSS with Röntgen style also for ways and relations, run `roentgen mapcss --ways`. +To create MapCSS with Map Machine style also for ways and relations, run `map-machine mapcss --ways`. | Option | Description | |---|---| @@ -298,15 +299,15 @@ To create MapCSS with Röntgen style also for ways and relations, run `roentgen | `--ways` | add style for ways and relations | | `--lifecycle` | add icons for lifecycle tags; be careful: this will increase the number of node and area selectors by 9 times, set by default | -### Use Röntgen as JOSM map paint style ### +### Use Map Machine as JOSM map paint style ### - * Run `roentgen mapcss`. + * Run `map-machine mapcss`. * Open [JOSM](https://josm.openstreetmap.de/). * Go to Preferences → Third tab on the left → Map Paint Styles. * Active styles: press +. - * URL / File: set path to `out/roentgen_mapcss/roentgen.mapcss`. + * URL / File: set path to `out/map_machine_mapcss/map_machine.mapcss`. -To enable / disable Röntgen map paint style go to ViewMap Paint StylesRöntgen. +To enable / disable Map Machine map paint style go to ViewMap Paint StylesMap Machine. #### Example #### @@ -315,5 +316,5 @@ To enable / disable Röntgen map paint style go to ViewMap Example of using Röntgen icons on top of Mapnik style in JOSM. Map Paint Styles look like: * ✓ Mapnik (true) - * ✓ Röntgen + * ✓ Map Machine diff --git a/data/githooks/pre-commit b/data/githooks/pre-commit index b1720f7..0ac53cd 100755 --- a/data/githooks/pre-commit +++ b/data/githooks/pre-commit @@ -1,8 +1,8 @@ #!/bin/sh echo "Checking code format with Black..." -if ! black -l 80 --check tests roentgen; then - black -l 80 --diff tests roentgen +if ! black -l 80 --check tests map_machine; then + black -l 80 --diff tests map_machine echo "FAIL" exit 1 fi diff --git a/data/githooks/pre-push b/data/githooks/pre-push index 07b4991..06840e3 100755 --- a/data/githooks/pre-push +++ b/data/githooks/pre-push @@ -10,8 +10,8 @@ else fi echo "Checking code format with Black..." -if ! black -l 80 --check tests roentgen; then - black -l 80 --diff tests roentgen +if ! black -l 80 --check tests map_machine; then + black -l 80 --diff tests map_machine echo "FAIL" exit 1 fi @@ -33,22 +33,22 @@ pytest -v || { echo "FAIL"; exit 1; } # Integration tests. echo "Test render" -python3 roentgen render -b 10.000,20.000,10.001,20.001 --cache tests/data \ +map-machine render -b 10.000,20.000,10.001,20.001 --cache tests/data \ || { echo "FAIL"; exit 1; } grep "natural: tree" out/map.svg || { echo "FAIL"; exit 1; } echo "Test icons" -python3 roentgen icons || { echo "FAIL"; exit 1; } +map-machine icons || { echo "FAIL"; exit 1; } echo "Test MapCSS generation" -python3 roentgen mapcss || { echo "FAIL"; exit 1; } +map-machine mapcss || { echo "FAIL"; exit 1; } echo "Test element generation" -python3 roentgen element --node amenity=bench,material=wood \ +map-machine element --node amenity=bench,material=wood \ || { echo "FAIL"; exit 1; } echo "Test tile generation" -python3 roentgen tile --coordinates 50.000,40.000 --cache tests/data \ +map-machine tile --coordinates 50.000,40.000 --cache tests/data \ || { echo "FAIL"; exit 1; } exit 0 diff --git a/doc/contributing.moi b/doc/contributing.moi index 82b4e03..9102968 100644 --- a/doc/contributing.moi +++ b/doc/contributing.moi @@ -1,6 +1,6 @@ \1 {Contributing} {contributing} -Thank you for your interest in the Röntgen project. Since the primary goal of the project is to cover as many tags as possible, the project is crucially depend on contributions as OpenStreetMap itself. +Thank you for your interest in the Map Machine project. Since the primary goal of the project is to cover as many tags as possible, the project is crucially depend on contributions as OpenStreetMap itself. \2 {Suggest a tag to support} {} @@ -17,7 +17,7 @@ Please, create an issue with \m {bug} and \m {generator} labels. /* \2 {Fix a typo in documentation} {} -This action is not that easy as it supposed to be. We use \ref {http://github.com/enzet/Moire} {Moire} markup and converter to automatically generate documentation for GitHub, website, and \ref {http://wiki.openstreetmap.org/} {OpenStreetMap wiki}. That's why editing Markdown files is not allowed. To fix a typo, open corresponding Moire file in \m {doc} directory (e.g. \m {doc/readme.moi} for \m {README.md}), modify it, and run \m {python roentgen doc} script. +This action is not that easy as it supposed to be. We use \ref {http://github.com/enzet/Moire} {Moire} markup and converter to automatically generate documentation for GitHub, website, and \ref {http://wiki.openstreetmap.org/} {OpenStreetMap wiki}. That's why editing Markdown files is not allowed. To fix a typo, open corresponding Moire file in \m {doc} directory (e.g. \m {doc/readme.moi} for \m {README.md}), modify it, and run \m {map-machine doc} script. */ \2 {Modify the code} {} diff --git a/doc/readme.moi b/doc/readme.moi index 710a9c3..861ed3f 100644 --- a/doc/readme.moi +++ b/doc/readme.moi @@ -1,31 +1,31 @@ -\title {Röntgen} +\title {Map Machine} \page_icon {out/icons_by_id/book.svg} -\b {Röntgen} (or \b {Roentgen} when ASCII is preferred) project consists of +\b {Map Machine} project consists of \list {simple Python \ref {http://openstreetmap.org} {OpenStreetMap} renderer and tile generator (see \ref {#usage-example} {usage}, \ref {#map-generation} {renderer documentation}, \ref {#tile-generation} {tile generation}),} - {\ref {#icon-set} {set of CC-BY 4.0 icons} that can be used outside the project.} + {\ref {#icon-set} {Röntgen icon set}\: unique CC-BY 4.0 icons.} -The idea behind the Röntgen project is to \b {show all the richness of the OpenStreetMap data}\: to have a possibility to \i {display any map feature} represented by OpenStreetMap data tags by means of colors, shapes, and icons. Röntgen is created for OpenStreetMap contributors\: to display all changes one made on the map even if they are small, and for users\: to dig down into the map and find every detail that was mapped. +The idea behind the Map Machine project is to \b {show all the richness of the OpenStreetMap data}\: to have a possibility to \i {display any map feature} represented by OpenStreetMap data tags by means of colors, shapes, and icons. Map Machine is created for OpenStreetMap contributors\: to display all changes one made on the map even if they are small, and for users\: to dig down into the map and find every detail that was mapped. -Unlike standard OpenStreetMap layers, \b {Röntgen is a playground for experiments} where one can easily try to support proposed tags, tags with little or even single usage, deprecated tags. +Unlike standard OpenStreetMap layers, \b {Map Machine is a playground for experiments} where one can easily try to support proposed tags, tags with little or even single usage, deprecated tags. -Röntgen is intended to be highly configurable, so it can generate precise but messy maps for OSM contributors as well as pretty and clean maps for OSM users, can use slow algorithms for some experimental features. +Map Machine is intended to be highly configurable, so it can generate precise but messy maps for OSM contributors as well as pretty and clean maps for OSM users, can use slow algorithms for some experimental features. \2 {Usage example} {usage-example} -\code {roentgen render -b 2.284,48.860,2.290,48.865} {bash} +\code {map-machine render -b 2.284,48.860,2.290,48.865} {bash} will automatically download OSM data and write output SVG map of the specified area to \m {out/map.svg}. See \ref {#map-generation} {Map generation}. -\code {roentgen tile -b 2.361,48.871,2.368,48.875} {bash} +\code {map-machine tile -b 2.361,48.871,2.368,48.875} {bash} will automatically download OSM data and write output PNG tiles that cover the specified area to \m {out/tiles} directory. See \ref {#tile-generation} {Tile generation}. \2 {Map features} {features} -Röntgen features\: +Map Machine features\: \list {detailed icons to display subtypes like \ref {#power-tower-design} {power tower design},} {can display multiple icons for one entity to cover more features,} @@ -89,11 +89,11 @@ There are \ref {https://en.wikipedia.org/wiki/List_of_Japanese_map_symbols} {spe \2 {Icon set} {icon-set} -The central feature of the project is Röntgen icon set. It is a set of monochrome 14 × 14 px pixel-aligned icons. Unlike the Röntgen source code, which is under MIT license, all icons are under \ref {http://creativecommons.org/licenses/by/4.0/} {CC BY} license. So, with the appropriate credit icon set can be used outside the project. Some icons can be used as emoji symbols. +The central feature of the project is Röntgen icon set. It is a set of monochrome 14 × 14 px pixel-aligned icons. Unlike the Map Machine source code, which is under MIT license, all icons are under \ref {http://creativecommons.org/licenses/by/4.0/} {CC BY} license. So, with the appropriate credit icon set can be used outside the project. Some icons can be used as emoji symbols. All icons tend to support common design style, which is heavily inspired by \ref {https://github.com/mapbox/maki} {Maki}, \ref {https://github.com/gmgeo/osmic} {Osmic}, and \ref {https://github.com/ideditor/temaki} {Temaki}. -Icons are used to visualize tags for nodes and areas. Unlike other renderers, Röntgen can use more than one icon to visualize an entity and use colors to visualize \osm {colour} value or other entity properties (like \osm {material} or \osm {genus}). +Icons are used to visualize tags for nodes and areas. Unlike other renderers, Map Machine can use more than one icon to visualize an entity and use colors to visualize \osm {colour} value or other entity properties (like \osm {material} or \osm {genus}). \image {doc/grid.png} {Icons} @@ -103,7 +103,7 @@ Generate icon grid and sets of individual icons with \m {\command {Test icon gen \3 {Shape combination} {shape_combination} -Röntgen constructs icons from the shapes extracted from the sketch SVG file. Some icons consists of just one shape, to construct other it may be necessary to combine two or more shapes. +Map Machine constructs icons from the shapes extracted from the sketch SVG file. Some icons consists of just one shape, to construct other it may be necessary to combine two or more shapes. \image {doc/bus_stop.png} {Bus stop icon combination} @@ -172,7 +172,7 @@ pip install .} {bash} Command \m {render} is used to generates SVG map from OpenStreetMap data. You can run it using\: -\code {roentgen render \\ +\code {map-machine render \\ -b \formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\ -o \formal {output file name} \\ -z \formal {OSM zoom level} \\ @@ -180,7 +180,7 @@ Command \m {render} is used to generates SVG map from OpenStreetMap data. You c \3 {Example} {example-2} -\code {roentgen render \\ +\code {map-machine render \\ --boundary-box 2.284,48.860,2.290,48.865 \\ --output out/esplanade_du_trocadéro.svg} {bash} @@ -194,7 +194,7 @@ plus \ref {#map-options} {map configuration options} \2 {Tile generation} {tile-generation} -Command \m {tile} is used to generate PNG tiles for \ref {https://wiki.openstreetmap.org/wiki/Slippy_Map} {slippy maps}. To use them, run \ref {#tile-server} {Röntgen tile server}. +Command \m {tile} is used to generate PNG tiles for \ref {https://wiki.openstreetmap.org/wiki/Slippy_Map} {slippy maps}. To use them, run \ref {#tile-server} {Map Machine tile server}. \options {tile} @@ -204,11 +204,11 @@ plus \ref {#map-options} {map configuration options} Specify tile coordinates\: -\code {roentgen tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}} {bash} +\code {map-machine tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}} {bash} or specify any geographical coordinates inside a tile\: -\code {roentgen tile \\ +\code {map-machine tile \\ --coordinates \formal {latitude},\formal {longitude} \\ --zoom \formal {OSM zoom levels}} {bash} @@ -216,7 +216,7 @@ Tile will be stored as SVG file \m {out/tiles/tile___.svg} and Example\: -\code {roentgen tile -c 55.7510637,37.6270761 -z 18} {bash} +\code {map-machine tile -c 55.7510637,37.6270761 -z 18} {bash} will generate SVG file \m {out/tiles/tile_18_158471_81953.svg} and PNG file \m {out/tiles/tile_18_158471_81953.png}. @@ -224,7 +224,7 @@ will generate SVG file \m {out/tiles/tile_18_158471_81953.svg} and PNG file \m { Specify boundary box to get the minimal set of tiles that covers the area\: -\code {roentgen tile \\ +\code {map-machine tile \\ --boundary-box \formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\ --zoom \formal {OSM zoom levels}} {bash} @@ -232,7 +232,7 @@ Boundary box will be extended to the boundaries of the minimal tile set that cov Example\: -\code {roentgen tile -b 2.361,48.871,2.368,48.875} {bash} +\code {map-machine tile -b 2.361,48.871,2.368,48.875} {bash} will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the way to 18/132796/90169 and two cached files \m {cache/2.360,48.869,2.370,48.877_18.svg} and \m {cache/2.360,48.869,2.370,48.877_18.png}. @@ -240,7 +240,7 @@ will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the wa Command \m {server} is used to run tile server for slippy maps. -\code {roentgen server} +\code {map-machine server} Stop server interrupting process with \kbd {Ctrl} + \kbd {C}. @@ -250,11 +250,11 @@ Stop server interrupting process with \kbd {Ctrl} + \kbd {C}. Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19\: -\code {roentgen tile -b 2.364,48.854,2.367,48.857 -z 16-19} {bash} +\code {map-machine tile -b 2.364,48.854,2.367,48.857 -z 16-19} {bash} Run tile server on 127.0.0.1\:8080\: -\code {roentgen server} {bash} +\code {map-machine server} {bash} Use JavaScript code for \ref {https://leafletjs.com/} {Leaflet}\: @@ -265,8 +265,8 @@ L.tileLayer('http://127.0.0.1:8080/tiles/\{z\}/\{x\}/\{y\}', \{ attribution: 'Map data © ' + 'OpenStreetMap ' + 'contributors, imagery © ' + - 'Röntgen', - id: 'roentgen', + 'Map Machine', + id: 'map_machine', tileSize: 256, zoomOffset: 0 \}).addTo(map);} {js} @@ -283,22 +283,22 @@ Map configuration options used by \m {render} and \m {tile} commands: \2 {MapCSS 0.2 generation} {mapcss-0-2-generation} -Command \m {mapcss} is used to generate MapCSS scheme. \m {\command {Test MapCSS 0.2 generation}} will create \m {out/roentgen_mapcss} directory with simple MapCSS 0.2 scheme adding icons from Röntgen icon set to nodes and areas\: \m {.mapcss} file and directory with icons. +Command \m {mapcss} is used to generate MapCSS scheme. \m {\command {Test MapCSS 0.2 generation}} will create \m {out/map_machine_mapcss} directory with simple MapCSS 0.2 scheme adding icons from Röntgen icon set to nodes and areas\: \m {.mapcss} file and directory with icons. -To create MapCSS with Röntgen style also for ways and relations, run \m {roentgen mapcss --ways}. +To create MapCSS with Map Machine style also for ways and relations, run \m {map-machine mapcss --ways}. \options {mapcss} -\3 {Use Röntgen as JOSM map paint style} +\3 {Use Map Machine as JOSM map paint style} \list {Run \m {\command {Test MapCSS 0.2 generation}}.} {Open \ref {https://josm.openstreetmap.de/} {JOSM}.} {Go to \kbd {Preferences} → Third tab on the left → \kbd {Map Paint Styles}.} {Active styles: press \kbd {+}.} - {URL / File: set path to \m {out/roentgen_mapcss/roentgen.mapcss}.} + {URL / File: set path to \m {out/map_machine_mapcss/map_machine.mapcss}.} -To enable / disable Röntgen map paint style go to \kbd {View} → \kbd {Map Paint Styles} → \kbd {Röntgen}. +To enable / disable Map Machine map paint style go to \kbd {View} → \kbd {Map Paint Styles} → \kbd {Map Machine}. \4 {Example} @@ -307,4 +307,4 @@ To enable / disable Röntgen map paint style go to \kbd {View} → \kbd {Map Pai Example of using Röntgen icons on top of Mapnik style in JOSM. Map Paint Styles look like\: \list {✓ Mapnik (true)} - {✓ Röntgen} + {✓ Map Machine} diff --git a/roentgen/__init__.py b/map_machine/__init__.py similarity index 64% rename from roentgen/__init__.py rename to map_machine/__init__.py index 19c3b25..7a85ff9 100644 --- a/roentgen/__init__.py +++ b/map_machine/__init__.py @@ -1,13 +1,13 @@ """ -Röntgen project: simple Python map renderer for OpenStreetMap and icon set. +Map Machine project: simple Python map renderer for OpenStreetMap and icon set. """ -__project__ = "Röntgen" +__project__ = "Map Machine" __description__ = ( "Simple Python map renderer for OpenStreetMap with custom icon set " "intended to display as many tags as possible" ) -__url__ = "https://github.com/enzet/Roentgen" +__url__ = "https://github.com/enzet/map-machine" __doc_url__ = f"{__url__}/blob/main/README.md" __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/map_machine/__main__.py b/map_machine/__main__.py new file mode 100644 index 0000000..875346d --- /dev/null +++ b/map_machine/__main__.py @@ -0,0 +1,7 @@ +""" +Map Machine entry point. +""" +from map_machine.main import main + +if __name__ == "__main__": + main() diff --git a/roentgen/boundary_box.py b/map_machine/boundary_box.py similarity index 100% rename from roentgen/boundary_box.py rename to map_machine/boundary_box.py diff --git a/roentgen/color.py b/map_machine/color.py similarity index 97% rename from roentgen/color.py rename to map_machine/color.py index e9a8840..b6d96cd 100644 --- a/roentgen/color.py +++ b/map_machine/color.py @@ -5,7 +5,7 @@ from typing import Any from colour import Color -from roentgen.util import MinMax +from map_machine.util import MinMax __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/constructor.py b/map_machine/constructor.py similarity index 95% rename from roentgen/constructor.py rename to map_machine/constructor.py index d39e6f5..47a7723 100644 --- a/roentgen/constructor.py +++ b/map_machine/constructor.py @@ -1,5 +1,5 @@ """ -Construct Röntgen nodes and ways. +Construct Map Machine nodes and ways. """ import logging from datetime import datetime @@ -9,9 +9,9 @@ from typing import Any, Iterator, Optional, Union import numpy as np from colour import Color -from roentgen import ui -from roentgen.color import get_gradient_color -from roentgen.figure import ( +from map_machine import ui +from map_machine.color import get_gradient_color +from map_machine.figure import ( Building, Crater, DirectionSector, @@ -19,20 +19,20 @@ from roentgen.figure import ( StyledFigure, Tree, ) -from roentgen.flinger import Flinger -from roentgen.map_configuration import DrawingMode, MapConfiguration +from map_machine.flinger import Flinger +from map_machine.map_configuration import DrawingMode, MapConfiguration # fmt: off -from roentgen.icon import ( +from map_machine.icon import ( DEFAULT_SMALL_SHAPE_ID, Icon, IconSet, Shape, ShapeExtractor, ShapeSpecification ) -from roentgen.osm_reader import OSMData, OSMNode, OSMRelation, OSMWay -from roentgen.point import Point -from roentgen.scheme import DEFAULT_COLOR, LineStyle, RoadMatcher, Scheme -from roentgen.text import Label -from roentgen.ui import BuildingMode -from roentgen.util import MinMax +from map_machine.osm_reader import OSMData, OSMNode, OSMRelation, OSMWay +from map_machine.point import Point +from map_machine.scheme import DEFAULT_COLOR, LineStyle, RoadMatcher, Scheme +from map_machine.text import Label +from map_machine.ui import BuildingMode +from map_machine.util import MinMax # fmt: on __author__ = "Sergey Vartanov" @@ -147,7 +147,7 @@ def try_to_glue( class Constructor: """ - Röntgen node and way constructor. + Map Machine node and way constructor. """ def __init__( @@ -199,7 +199,7 @@ class Constructor: self.construct_nodes() def construct_ways(self) -> None: - """Construct Röntgen ways.""" + """Construct Map Machine ways.""" for index, way_id in enumerate(self.osm_data.ways): ui.progress_bar( index, @@ -349,7 +349,7 @@ class Constructor: ) def construct_relations(self) -> None: - """Construct Röntgen ways from OSM relations.""" + """Construct Map Machine ways from OSM relations.""" for relation_id in self.osm_data.relations: relation: OSMRelation = self.osm_data.relations[relation_id] tags: dict[str, str] = relation.tags diff --git a/roentgen/direction.py b/map_machine/direction.py similarity index 99% rename from roentgen/direction.py rename to map_machine/direction.py index 56b003d..e915cf0 100644 --- a/roentgen/direction.py +++ b/map_machine/direction.py @@ -6,7 +6,7 @@ from typing import Iterator, Optional import numpy as np from portolan import middle -from roentgen.drawing import PathCommands +from map_machine.drawing import PathCommands __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/drawing.py b/map_machine/drawing.py similarity index 100% rename from roentgen/drawing.py rename to map_machine/drawing.py diff --git a/roentgen/element.py b/map_machine/element.py similarity index 90% rename from roentgen/element.py rename to map_machine/element.py index 4f5da80..68726af 100644 --- a/roentgen/element.py +++ b/map_machine/element.py @@ -9,11 +9,11 @@ import numpy as np import svgwrite from svgwrite.path import Path as SVGPath -from roentgen.icon import ShapeExtractor -from roentgen.point import Point -from roentgen.scheme import LineStyle, Scheme -from roentgen.text import Label -from roentgen.workspace import workspace +from map_machine.icon import ShapeExtractor +from map_machine.point import Point +from map_machine.scheme import LineStyle, Scheme +from map_machine.text import Label +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/figure.py b/map_machine/figure.py similarity index 98% rename from roentgen/figure.py rename to map_machine/figure.py index 6874444..a9fc29e 100644 --- a/roentgen/figure.py +++ b/map_machine/figure.py @@ -9,12 +9,12 @@ from svgwrite import Drawing from svgwrite.container import Group from svgwrite.path import Path -from roentgen.direction import DirectionSet, Sector -from roentgen.drawing import PathCommands -from roentgen.flinger import Flinger -from roentgen.osm_reader import OSMNode, Tagged -from roentgen.road import Lane -from roentgen.scheme import LineStyle, RoadMatcher, Scheme +from map_machine.direction import DirectionSet, Sector +from map_machine.drawing import PathCommands +from map_machine.flinger import Flinger +from map_machine.osm_reader import OSMNode, Tagged +from map_machine.road import Lane +from map_machine.scheme import LineStyle, RoadMatcher, Scheme __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/flinger.py b/map_machine/flinger.py similarity index 98% rename from roentgen/flinger.py rename to map_machine/flinger.py index 1efeb15..95c1063 100644 --- a/roentgen/flinger.py +++ b/map_machine/flinger.py @@ -5,7 +5,7 @@ from typing import Optional import numpy as np -from roentgen.boundary_box import BoundaryBox +from map_machine.boundary_box import BoundaryBox __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/grid.py b/map_machine/grid.py similarity index 97% rename from roentgen/grid.py rename to map_machine/grid.py index ea9a1cc..57431f6 100644 --- a/roentgen/grid.py +++ b/map_machine/grid.py @@ -11,9 +11,9 @@ from colour import Color from svgwrite import Drawing from svgwrite.shapes import Rect -from roentgen.icon import Icon, Shape, ShapeExtractor, ShapeSpecification -from roentgen.scheme import NodeMatcher, Scheme -from roentgen.workspace import workspace +from map_machine.icon import Icon, Shape, ShapeExtractor, ShapeSpecification +from map_machine.scheme import NodeMatcher, Scheme +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/icon.py b/map_machine/icon.py similarity index 99% rename from roentgen/icon.py rename to map_machine/icon.py index 7d84a20..b15b925 100644 --- a/roentgen/icon.py +++ b/map_machine/icon.py @@ -18,7 +18,7 @@ from svgwrite.base import BaseElement from svgwrite.container import Group from svgwrite.path import Path as SVGPath -from roentgen.color import is_bright +from map_machine.color import is_bright __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/icons/LICENSE b/map_machine/icons/LICENSE similarity index 100% rename from roentgen/icons/LICENSE rename to map_machine/icons/LICENSE diff --git a/roentgen/icons/colors.svg b/map_machine/icons/colors.svg similarity index 100% rename from roentgen/icons/colors.svg rename to map_machine/icons/colors.svg diff --git a/roentgen/icons/config.json b/map_machine/icons/config.json similarity index 100% rename from roentgen/icons/config.json rename to map_machine/icons/config.json diff --git a/roentgen/icons/icons.svg b/map_machine/icons/icons.svg similarity index 100% rename from roentgen/icons/icons.svg rename to map_machine/icons/icons.svg diff --git a/roentgen/main.py b/map_machine/main.py similarity index 65% rename from roentgen/main.py rename to map_machine/main.py index 2b80cd6..7e7993f 100644 --- a/roentgen/main.py +++ b/map_machine/main.py @@ -1,20 +1,20 @@ """ -Röntgen entry point. +Map Machine entry point. """ import argparse import logging import sys from pathlib import Path -from roentgen.ui import parse_options -from roentgen.workspace import Workspace +from map_machine.ui import parse_options +from map_machine.workspace import Workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" def main() -> None: - """Röntgen command-line entry point.""" + """Map Machine command-line entry point.""" logging.basicConfig(format="%(levelname)s %(message)s", level=logging.INFO) workspace: Workspace = Workspace(Path("out")) @@ -24,38 +24,38 @@ def main() -> None: print("No command provided. See --help.") elif arguments.command == "render": - from roentgen import mapper + from map_machine import mapper mapper.ui(arguments) elif arguments.command == "tile": - from roentgen import tile + from map_machine import tile tile.ui(arguments) elif arguments.command == "icons": - from roentgen.grid import draw_icons + from map_machine.grid import draw_icons draw_icons() elif arguments.command == "mapcss": - from roentgen import mapcss + from map_machine import mapcss mapcss.ui(arguments) elif arguments.command == "element": - from roentgen.element import draw_element + from map_machine.element import draw_element draw_element(arguments) elif arguments.command == "server": - from roentgen import server + from map_machine import server server.ui(arguments) elif arguments.command == "taginfo": - from roentgen.scheme import Scheme - from roentgen.taginfo import write_taginfo_project_file + from map_machine.scheme import Scheme + from map_machine.taginfo import write_taginfo_project_file write_taginfo_project_file(Scheme(workspace.DEFAULT_SCHEME_PATH)) diff --git a/roentgen/map_configuration.py b/map_machine/map_configuration.py similarity index 100% rename from roentgen/map_configuration.py rename to map_machine/map_configuration.py diff --git a/roentgen/mapcss.py b/map_machine/mapcss.py similarity index 92% rename from roentgen/mapcss.py rename to map_machine/mapcss.py index 62cbb9b..371748d 100644 --- a/roentgen/mapcss.py +++ b/map_machine/mapcss.py @@ -8,12 +8,12 @@ from typing import Optional, TextIO from colour import Color -from roentgen import __project__, __url__ -from roentgen.grid import IconCollection -from roentgen.icon import ShapeExtractor -from roentgen.osm_reader import STAGES_OF_DECAY -from roentgen.scheme import Matcher, Scheme -from roentgen.workspace import workspace +from map_machine import __project__, __url__ +from map_machine.grid import IconCollection +from map_machine.icon import ShapeExtractor +from map_machine.osm_reader import STAGES_OF_DECAY +from map_machine.scheme import Matcher, Scheme +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" @@ -59,7 +59,7 @@ Map paint style that adds icons from Röntgen icon set meta {{ title: "{__project__}"; - description: "Röntgen map paint style for JOSM"; + description: "Map Machine map paint style for JOSM"; author: "{__author__}"; version: "0.1"; link: "{__url__}"; @@ -68,7 +68,7 @@ meta {{ class MapCSSWriter: """ - Writer that converts Röntgen scheme into MapCSS 0.2 format. + Writer that converts Map Machine scheme into MapCSS 0.2 format. """ def __init__( @@ -98,7 +98,7 @@ class MapCSSWriter: Add MapCSS 0.2 selector for node, way, relation, or area. :param target: `node`, `way`, `relation`, or `area` - :param matcher: tag matcher of Röntgen scheme + :param matcher: tag matcher of Map Machine scheme :param prefix: tag prefix :param opacity: icon opacity :return: string representation of selector diff --git a/roentgen/mapper.py b/map_machine/mapper.py similarity index 93% rename from roentgen/mapper.py rename to map_machine/mapper.py index 97380bd..2bfb83b 100644 --- a/roentgen/mapper.py +++ b/map_machine/mapper.py @@ -13,19 +13,19 @@ from svgwrite.container import Group from svgwrite.path import Path as SVGPath from svgwrite.shapes import Rect -from roentgen.boundary_box import BoundaryBox -from roentgen.constructor import Constructor -from roentgen.figure import Road, StyledFigure -from roentgen.flinger import Flinger -from roentgen.icon import ShapeExtractor -from roentgen.map_configuration import LabelMode, MapConfiguration -from roentgen.osm_getter import NetworkError, get_osm -from roentgen.osm_reader import OSMData, OSMNode, OSMReader, OverpassReader -from roentgen.point import Occupied, Point -from roentgen.road import Intersection, RoadPart -from roentgen.scheme import Scheme -from roentgen.ui import BuildingMode, progress_bar -from roentgen.workspace import workspace +from map_machine.boundary_box import BoundaryBox +from map_machine.constructor import Constructor +from map_machine.figure import Road, StyledFigure +from map_machine.flinger import Flinger +from map_machine.icon import ShapeExtractor +from map_machine.map_configuration import LabelMode, MapConfiguration +from map_machine.osm_getter import NetworkError, get_osm +from map_machine.osm_reader import OSMData, OSMNode, OSMReader, OverpassReader +from map_machine.point import Occupied, Point +from map_machine.road import Intersection, RoadPart +from map_machine.scheme import Scheme +from map_machine.ui import BuildingMode, progress_bar +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" @@ -215,7 +215,7 @@ class Map: def ui(options: argparse.Namespace) -> None: """ - Röntgen entry point. + Map Machine entry point. :param options: command-line arguments """ diff --git a/roentgen/moire_manager.py b/map_machine/moire_manager.py similarity index 94% rename from roentgen/moire_manager.py rename to map_machine/moire_manager.py index ba35a58..b039079 100644 --- a/roentgen/moire_manager.py +++ b/map_machine/moire_manager.py @@ -1,5 +1,5 @@ """ -Moire markup extension for Röntgen. +Moire markup extension for Map Machine. """ import argparse from abc import ABC @@ -10,9 +10,9 @@ import yaml from moire.default import Default, DefaultHTML, DefaultMarkdown, DefaultWiki from moire.moire import Tag -from roentgen import ui -from roentgen.icon import ShapeExtractor -from roentgen.workspace import workspace +from map_machine import ui +from map_machine.icon import ShapeExtractor +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" @@ -143,9 +143,9 @@ test_configuration: TestConfiguration = TestConfiguration( ) -class RoentgenMoire(Default, ABC): +class MapMachineMoire(Default, ABC): """ - Moire extension stub for Röntgen. + Moire extension stub for Map Machine. """ def osm(self, args: Arguments) -> str: @@ -212,7 +212,7 @@ class RoentgenMoire(Default, ABC): return self.parse(args[0]) -class RoentgenHTML(RoentgenMoire, DefaultHTML): +class MapMachineHTML(MapMachineMoire, DefaultHTML): """ Simple HTML. """ @@ -272,7 +272,7 @@ class RoentgenHTML(RoentgenMoire, DefaultHTML): return f'{self.parse(args[0])}' -class RoentgenOSMWiki(RoentgenMoire, DefaultWiki): +class MapMachineOSMWiki(MapMachineMoire, DefaultWiki): """ OpenStreetMap wiki. @@ -307,7 +307,7 @@ class RoentgenOSMWiki(RoentgenMoire, DefaultWiki): return f"[[File:Röntgen {name}.svg|{size}px]]" -class RoentgenMarkdown(RoentgenMoire, DefaultMarkdown): +class MapMachineMarkdown(MapMachineMoire, DefaultMarkdown): """ GitHub flavored markdown. """ @@ -335,3 +335,9 @@ class RoentgenMarkdown(RoentgenMoire, DefaultMarkdown): def formal(self, args: Arguments) -> str: """Formal variable.""" return f"<{self.parse(args[0])}>" + + +if __name__ == "__main__": + with Path("doc/readme.moi").open() as input_file: + with Path("README.md").open("w+") as output_file: + output_file.write(MapMachineMarkdown().convert(input_file.read())) diff --git a/roentgen/osm_getter.py b/map_machine/osm_getter.py similarity index 97% rename from roentgen/osm_getter.py rename to map_machine/osm_getter.py index d05a766..13f34cb 100644 --- a/roentgen/osm_getter.py +++ b/map_machine/osm_getter.py @@ -8,7 +8,7 @@ from pathlib import Path import urllib3 -from roentgen.boundary_box import BoundaryBox +from map_machine.boundary_box import BoundaryBox __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/osm_reader.py b/map_machine/osm_reader.py similarity index 99% rename from roentgen/osm_reader.py rename to map_machine/osm_reader.py index a586f4b..9a720b3 100644 --- a/roentgen/osm_reader.py +++ b/map_machine/osm_reader.py @@ -12,8 +12,8 @@ from xml.etree.ElementTree import Element import numpy as np -from roentgen.boundary_box import BoundaryBox -from roentgen.util import MinMax +from map_machine.boundary_box import BoundaryBox +from map_machine.util import MinMax __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/point.py b/map_machine/point.py similarity index 97% rename from roentgen/point.py rename to map_machine/point.py index 57e3b17..3d5bf24 100644 --- a/roentgen/point.py +++ b/map_machine/point.py @@ -7,10 +7,10 @@ import numpy as np import svgwrite from colour import Color -from roentgen.icon import Icon, IconSet -from roentgen.map_configuration import LabelMode -from roentgen.osm_reader import Tagged -from roentgen.text import Label +from map_machine.icon import Icon, IconSet +from map_machine.map_configuration import LabelMode +from map_machine.osm_reader import Tagged +from map_machine.text import Label __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/road.py b/map_machine/road.py similarity index 99% rename from roentgen/road.py rename to map_machine/road.py index 144b3dc..0679c4d 100644 --- a/roentgen/road.py +++ b/map_machine/road.py @@ -8,7 +8,7 @@ import numpy as np import svgwrite from svgwrite.path import Path -from roentgen.vector import Line, compute_angle, norm, turn_by_angle +from map_machine.vector import Line, compute_angle, norm, turn_by_angle __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/scheme.py b/map_machine/scheme.py similarity index 99% rename from roentgen/scheme.py rename to map_machine/scheme.py index e7c21d2..a3c2a83 100644 --- a/roentgen/scheme.py +++ b/map_machine/scheme.py @@ -1,5 +1,5 @@ """ -Röntgen drawing scheme. +Map Machine drawing scheme. """ import logging from dataclasses import dataclass @@ -11,8 +11,8 @@ import numpy as np import yaml from colour import Color -from roentgen.direction import DirectionSet -from roentgen.icon import ( +from map_machine.direction import DirectionSet +from map_machine.icon import ( DEFAULT_COLOR, DEFAULT_SHAPE_ID, Icon, @@ -21,7 +21,7 @@ from roentgen.icon import ( ShapeExtractor, ShapeSpecification, ) -from roentgen.text import Label, get_address, get_text +from map_machine.text import Label, get_address, get_text __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/scheme/default.yml b/map_machine/scheme/default.yml similarity index 100% rename from roentgen/scheme/default.yml rename to map_machine/scheme/default.yml diff --git a/roentgen/server.py b/map_machine/server.py similarity index 95% rename from roentgen/server.py rename to map_machine/server.py index b692f38..ad0d3f3 100644 --- a/roentgen/server.py +++ b/map_machine/server.py @@ -1,5 +1,5 @@ """ -Röntgen tile server for slippy maps. +Map Machine tile server for slippy maps. """ import argparse import logging @@ -9,8 +9,8 @@ from typing import Optional import cairosvg -from roentgen.tile import Tile -from roentgen.workspace import workspace +from map_machine.tile import Tile +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/taginfo.py b/map_machine/taginfo.py similarity index 88% rename from roentgen/taginfo.py rename to map_machine/taginfo.py index 1370248..94c0cd2 100644 --- a/roentgen/taginfo.py +++ b/map_machine/taginfo.py @@ -8,7 +8,7 @@ import logging from datetime import datetime from pathlib import Path -from roentgen import ( +from map_machine import ( __author__, __description__, __doc_url__, @@ -16,8 +16,8 @@ from roentgen import ( __project__, __url__, ) -from roentgen.scheme import Scheme -from roentgen.workspace import workspace +from map_machine.scheme import Scheme +from map_machine.workspace import workspace class TaginfoProjectFile: @@ -37,7 +37,7 @@ class TaginfoProjectFile: "description": __description__, "project_url": __url__, "doc_url": __doc_url__, - "icon_url": "http://enzet.ru/roentgen/image/logo.png", + "icon_url": "http://enzet.ru/map-machine/image/logo.png", "contact_name": __author__, "contact_email": __email__, }, @@ -66,7 +66,7 @@ class TaginfoProjectFile: "value": value, "object_types": ["node", "area"], "description": "Rendered", - "icon_url": "http://enzet.ru/roentgen/" + "icon_url": "http://enzet.ru/map-machine/" f"roentgen_icons_mapcss/{icon_id}.svg", } tags.append(tag) @@ -80,7 +80,7 @@ class TaginfoProjectFile: def write_taginfo_project_file(scheme: Scheme) -> None: """Write Taginfo JSON file.""" out_file: Path = workspace.get_taginfo_file_path() - logging.info(f"Write Röntgen project file for Taginfo to {out_file}...") + logging.info(f"Write Map Machine project file for Taginfo to {out_file}...") taginfo_project_file: TaginfoProjectFile = TaginfoProjectFile( out_file, scheme ) diff --git a/roentgen/text.py b/map_machine/text.py similarity index 100% rename from roentgen/text.py rename to map_machine/text.py diff --git a/roentgen/tile.py b/map_machine/tile.py similarity index 97% rename from roentgen/tile.py rename to map_machine/tile.py index a5fb3b2..a9e9f65 100644 --- a/roentgen/tile.py +++ b/map_machine/tile.py @@ -15,16 +15,16 @@ import numpy as np import svgwrite from PIL import Image -from roentgen.boundary_box import BoundaryBox -from roentgen.constructor import Constructor -from roentgen.flinger import Flinger -from roentgen.icon import ShapeExtractor -from roentgen.map_configuration import MapConfiguration -from roentgen.mapper import Map -from roentgen.osm_getter import NetworkError, get_osm -from roentgen.osm_reader import OSMData, OSMReader -from roentgen.scheme import Scheme -from roentgen.workspace import workspace +from map_machine.boundary_box import BoundaryBox +from map_machine.constructor import Constructor +from map_machine.flinger import Flinger +from map_machine.icon import ShapeExtractor +from map_machine.map_configuration import MapConfiguration +from map_machine.mapper import Map +from map_machine.osm_getter import NetworkError, get_osm +from map_machine.osm_reader import OSMData, OSMReader +from map_machine.scheme import Scheme +from map_machine.workspace import workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/roentgen/ui.py b/map_machine/ui.py similarity index 95% rename from roentgen/ui.py rename to map_machine/ui.py index 95509f4..d163191 100644 --- a/roentgen/ui.py +++ b/map_machine/ui.py @@ -4,9 +4,9 @@ Command-line user interface. import argparse import sys -from roentgen import __version__ -from roentgen.map_configuration import BuildingMode, DrawingMode, LabelMode -from roentgen.osm_reader import STAGES_OF_DECAY +from map_machine import __version__ +from map_machine.map_configuration import BuildingMode, DrawingMode, LabelMode +from map_machine.osm_reader import STAGES_OF_DECAY __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" @@ -16,15 +16,15 @@ BOXES_LENGTH: int = len(BOXES) def parse_options(args: list[str]) -> argparse.Namespace: - """Parse Röntgen command-line options.""" + """Parse Map Machine command-line options.""" parser: argparse.ArgumentParser = argparse.ArgumentParser( - description="Röntgen. OpenStreetMap renderer with custom icon set" + description="Map Machine. OpenStreetMap renderer with custom icon set" ) parser.add_argument( "-v", "--version", action="version", - version="Röntgen " + __version__, + version="Map Machine " + __version__, ) subparser = parser.add_subparsers(dest="command") diff --git a/roentgen/util.py b/map_machine/util.py similarity index 97% rename from roentgen/util.py rename to map_machine/util.py index 0128d9b..d548e17 100644 --- a/roentgen/util.py +++ b/map_machine/util.py @@ -1,5 +1,5 @@ """ -Röntgen utility file. +Utility file. """ from dataclasses import dataclass from typing import Any diff --git a/roentgen/vector.py b/map_machine/vector.py similarity index 100% rename from roentgen/vector.py rename to map_machine/vector.py diff --git a/roentgen/workspace.py b/map_machine/workspace.py similarity index 92% rename from roentgen/workspace.py rename to map_machine/workspace.py index 3a78086..6377747 100644 --- a/roentgen/workspace.py +++ b/map_machine/workspace.py @@ -39,7 +39,7 @@ class Workspace: self._icons_by_id_path: Path = output_path / "icons_by_id" self._icons_by_name_path: Path = output_path / "icons_by_name" - self._mapcss_path: Path = output_path / "roentgen_mapcss" + self._mapcss_path: Path = output_path / "map_machine_mapcss" self._tile_path: Path = output_path / "tiles" def get_icons_by_id_path(self) -> Path: @@ -60,7 +60,7 @@ class Workspace: def get_mapcss_file_path(self) -> Path: """Directory for MapCSS files.""" - return self.get_mapcss_path() / "roentgen.mapcss" + return self.get_mapcss_path() / "map_machine.mapcss" def get_mapcss_icons_path(self) -> Path: """Directory for icons used by MapCSS file.""" @@ -74,7 +74,7 @@ class Workspace: def get_taginfo_file_path(self) -> Path: """Path to file with project information for Taginfo.""" - return self.output_path / "roentgen_taginfo.json" + return self.output_path / "map_machine_taginfo.json" workspace = Workspace(Path("out")) diff --git a/roentgen/__main__.py b/roentgen/__main__.py deleted file mode 100644 index 1b0b209..0000000 --- a/roentgen/__main__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" -Röntgen entry point. -""" -from roentgen.main import main - -if __name__ == "__main__": - main() diff --git a/setup.py b/setup.py index 6947e4b..699f3e0 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ """ -Röntgen project dynamic metadata. +Map Machine project dynamic metadata. """ from pathlib import Path from setuptools import setup -from roentgen import ( +from map_machine import ( __author__, __description__, __doc_url__, @@ -17,9 +17,9 @@ with Path("README.md").open() as input_file: long_description: str = input_file.read() setup( - name="roentgen-map", + name="map-machine", version=__version__, - packages=["roentgen"], + packages=["map_machine"], url=__url__, project_urls={ "Bug Tracker": f"{__url__}/issues", @@ -33,16 +33,16 @@ setup( author=__author__, author_email=__email__, description=__description__, - long_description="Röntgen is a Python OpenStreetMap renderer and tile " + long_description="Map Machine is a Python OpenStreetMap renderer and tile " "generator with a custom set of CC-BY 4.0 icons aimed to display as many " "map features as possible.\n\n" f"See [full documentation]({__doc_url__}).", long_description_content_type="text/markdown", entry_points={ - "console_scripts": ["roentgen=roentgen.main:main"], + "console_scripts": ["map-machine=map_machine.main:main"], }, package_data={ - "roentgen": [ + "map_machine": [ "icons/icons.svg", "icons/config.json", "icons/LICENSE", diff --git a/tests/__init__.py b/tests/__init__.py index 58f1b26..eccd2af 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,11 +1,11 @@ """ -Tests for Röntgen project. +Tests for Map Machine project. """ from pathlib import Path -from roentgen.icon import ShapeExtractor -from roentgen.scheme import Scheme -from roentgen.workspace import Workspace +from map_machine.icon import ShapeExtractor +from map_machine.scheme import Scheme +from map_machine.workspace import Workspace __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_boundary_box.py b/tests/test_boundary_box.py index 3adfd6c..7df256e 100644 --- a/tests/test_boundary_box.py +++ b/tests/test_boundary_box.py @@ -1,7 +1,7 @@ """ Test boundary box. """ -from roentgen.boundary_box import BoundaryBox +from map_machine.boundary_box import BoundaryBox __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_color.py b/tests/test_color.py index 5e5caea..8c7b37d 100644 --- a/tests/test_color.py +++ b/tests/test_color.py @@ -3,8 +3,8 @@ Test color functions. """ from colour import Color -from roentgen.color import get_gradient_color, is_bright -from roentgen.util import MinMax +from map_machine.color import get_gradient_color, is_bright +from map_machine.util import MinMax __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_direction.py b/tests/test_direction.py index 63fe63a..410864d 100644 --- a/tests/test_direction.py +++ b/tests/test_direction.py @@ -3,7 +3,7 @@ Test direction processing. """ import numpy as np -from roentgen.direction import DirectionSet, parse_vector +from map_machine.direction import DirectionSet, parse_vector __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_flinger.py b/tests/test_flinger.py index 26d40ec..9819a03 100644 --- a/tests/test_flinger.py +++ b/tests/test_flinger.py @@ -3,7 +3,10 @@ Test coordinates computation. """ import numpy as np -from roentgen.flinger import osm_zoom_level_to_pixels_per_meter, pseudo_mercator +from map_machine.flinger import ( + osm_zoom_level_to_pixels_per_meter, + pseudo_mercator, +) __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_icons.py b/tests/test_icons.py index fbde3b9..484747c 100644 --- a/tests/test_icons.py +++ b/tests/test_icons.py @@ -3,8 +3,8 @@ Test icon generation for nodes. """ import pytest -from roentgen.grid import IconCollection -from roentgen.icon import IconSet +from map_machine.grid import IconCollection +from map_machine.icon import IconSet from tests import SCHEME, SHAPE_EXTRACTOR, workspace __author__ = "Sergey Vartanov" diff --git a/tests/test_label.py b/tests/test_label.py index fc89cbc..23b7a60 100644 --- a/tests/test_label.py +++ b/tests/test_label.py @@ -1,7 +1,7 @@ """ Test label generation for nodes. """ -from roentgen.text import Label +from map_machine.text import Label from tests import SCHEME __author__ = "Sergey Vartanov" diff --git a/tests/test_mapcss.py b/tests/test_mapcss.py index 7c3a53b..d93537c 100644 --- a/tests/test_mapcss.py +++ b/tests/test_mapcss.py @@ -1,8 +1,8 @@ """ Test MapCSS generation. """ -from roentgen.mapcss import MapCSSWriter -from roentgen.scheme import NodeMatcher +from map_machine.mapcss import MapCSSWriter +from map_machine.scheme import NodeMatcher from tests import SCHEME __author__ = "Sergey Vartanov" diff --git a/tests/test_osm_reader.py b/tests/test_osm_reader.py index 6298689..276cb55 100644 --- a/tests/test_osm_reader.py +++ b/tests/test_osm_reader.py @@ -3,7 +3,13 @@ Test OSM XML parsing. """ import numpy as np -from roentgen.osm_reader import OSMNode, OSMReader, OSMRelation, OSMWay, OSMData +from map_machine.osm_reader import ( + OSMNode, + OSMReader, + OSMRelation, + OSMWay, + OSMData, +) __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_tag.py b/tests/test_tag.py index 7832c12..7d08354 100644 --- a/tests/test_tag.py +++ b/tests/test_tag.py @@ -3,7 +3,7 @@ Tests for length tag parsing. """ from typing import Optional -from roentgen.osm_reader import Tagged +from map_machine.osm_reader import Tagged __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_text.py b/tests/test_text.py index 156c719..ab8e660 100644 --- a/tests/test_text.py +++ b/tests/test_text.py @@ -1,7 +1,7 @@ """ Test text generation. """ -from roentgen.text import format_voltage +from map_machine.text import format_voltage __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_vector.py b/tests/test_vector.py index 2d06a93..d644e6a 100644 --- a/tests/test_vector.py +++ b/tests/test_vector.py @@ -3,7 +3,7 @@ Test vector operations. """ import numpy as np -from roentgen.vector import compute_angle, turn_by_angle +from map_machine.vector import compute_angle, turn_by_angle __author__ = "Sergey Vartanov" __email__ = "me@enzet.ru" diff --git a/tests/test_zoom_level.py b/tests/test_zoom_level.py index 0378c89..f4b3428 100644 --- a/tests/test_zoom_level.py +++ b/tests/test_zoom_level.py @@ -1,7 +1,7 @@ """ Test zoom level specification parsing. """ -from roentgen.tile import ScaleConfigurationException, parse_zoom_level +from map_machine.tile import ScaleConfigurationException, parse_zoom_level def test_zoom_level_1() -> None: