Add missing articles in readme.

This commit is contained in:
Martin Fischer 2022-10-09 11:14:16 +04:00 committed by Sergey Vartanov
parent 836caf7138
commit 1f87ff422a
3 changed files with 69 additions and 68 deletions

View file

@ -1,12 +1,12 @@
**Map Machine** project consists of
The **Map Machine** project consists of
* Python [OpenStreetMap](http://openstreetmap.org) renderer:
* a Python [OpenStreetMap](http://openstreetmap.org) renderer:
* SVG [map generation](#map-generation),
* SVG and PNG [tile generation](#tile-generation),
* [Röntgen](#röntgen-icon-set) icon set: unique CC-BY 4.0 map icons.
* the [Röntgen](#röntgen-icon-set) icon set: unique CC-BY 4.0 map icons.
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 both for map contributors: to display all changes one made on the map even if they are small, and for map users: to dig down into the map and find every detail that was mapped.
@ -27,18 +27,18 @@ Usage example
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).
will automatically download OSM data and render an SVG map of the specified area to `out/map.svg`. See [Map generation](#map-generation).
```shell
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 the `out/tiles` directory. See [Tile generation](#tile-generation).
will automatically download OSM data and render PNG tiles that cover the specified area to the `out/tiles` directory. See [Tile generation](#tile-generation).
Röntgen 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 specially created for Map Machine project. 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.
The central feature of the project is the Röntgen icon set. It is a set of monochrome 14 × 14 px pixel-aligned icons specially created for the Map Machine project. Unlike the Map Machine source code, which is under the MIT license, all icons are under the [CC BY](http://creativecommons.org/licenses/by/4.0/) license. So, with the appropriate credit the icon set can be used outside the project. Some icons can be used as emoji symbols.
All icons tend to support a 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).
@ -46,14 +46,14 @@ All icons tend to support a common design style, which is heavily inspired by [M
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 the final goal is to cover all tags. However, commonly used tags have priority, other things being equal.
Generate icon grid and sets of individual icons with `map-machine icons`. It will update `doc/grid.svg` file, and create 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 an icon grid and sets of individual icons with `map-machine icons`. It will update the `doc/grid.svg` file, and create SVG files in the `out/icons_by_id` directory where files are named using shape identifiers (e.g. `power_tower_portal_2_level.svg`) and in the `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 the 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)).
Map features
------------
### Extra icons ###
Map Machine uses icons to visualize tags for nodes and areas. But 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)).
Map Machine uses icons to visualize tags for nodes and areas. But unlike other renderers, Map Machine can use more than one icon to visualize an entity and can 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)).
### Isometric building shapes ###
@ -63,7 +63,7 @@ With `--buildings isometric` or `--buildings isometric-no-parts` (not set by def
### Road lanes ###
To determine road width Map Machine uses the [`width`](https://wiki.openstreetmap.org/wiki/Key:width) tag value or estimates it based on the [`lanes`](https://wiki.openstreetmap.org/wiki/Key:lanes) value. If lane value is specified, it also draws lane separators. This map style is highly inspired by Christoph Hormann's post [Navigating the Maze](http://blog.imagico.de/navigating-the-maze-part-2/).
To determine the road width Map Machine uses the [`width`](https://wiki.openstreetmap.org/wiki/Key:width) tag value or estimates it based on the [`lanes`](https://wiki.openstreetmap.org/wiki/Key:lanes) value. If lane value is specified, it also draws lane separators. This map style is highly inspired by Christoph Hormann's post [Navigating the Maze](http://blog.imagico.de/navigating-the-maze-part-2/).
![Road lanes](doc/lanes.svg)
@ -91,7 +91,7 @@ Visualize [`design`](https://wiki.openstreetmap.org/wiki/Key:design) values used
### Colors ###
Map icons have [`colour`](https://wiki.openstreetmap.org/wiki/Key:colour) tag value if it is present, otherwise, icons are displayed with dark grey color by default, purple color for shop nodes, red color for emergency features, and special colors for natural features. Map Machine also takes into account [`building:colour`](https://wiki.openstreetmap.org/wiki/Key:building:colour), [`roof:colour`](https://wiki.openstreetmap.org/wiki/Key:roof:colour) and other `*:colour` tags, and uses [`colour`](https://wiki.openstreetmap.org/wiki/Key:colour) tag value to paint subway lines.
Map icons have [`colour`](https://wiki.openstreetmap.org/wiki/Key:colour) tag value if it is present, otherwise, icons are displayed with dark grey color by default, purple color for shop nodes, red color for emergency features, and special colors for natural features. Map Machine also takes into account [`building:colour`](https://wiki.openstreetmap.org/wiki/Key:building:colour), [`roof:colour`](https://wiki.openstreetmap.org/wiki/Key:roof:colour) and other `*:colour` tags, and uses the [`colour`](https://wiki.openstreetmap.org/wiki/Key:colour) tag value to paint subway lines.
![Building colors](doc/colors.svg)
@ -107,7 +107,7 @@ Japanese maps usually use [special symbols](https://en.wikipedia.org/wiki/List_o
### Indoor features ###
Draw indoor features specifying level with `--level` option. Possible values are numbers (e.g. `1`, `0.5`), lists of number separated by `;` (e.g. `1;2;4;4.5`), `all`, `overground`, and `underground`. Default value is not `all`, but `overground`, so underground objects are not shown on the map if `--level` option is not specified.
Draw indoor features specifying level with `--level` option. Possible values are numbers (e.g. `1`, `0.5`), lists of number separated by `;` (e.g. `1;2;4;4.5`), `all`, `overground`, and `underground`. The default value is not `all`, but `overground`, so underground objects are not shown on the map if `--level` option is not specified.
```shell
map-machine render -c 4.5978,-74.07507 -s 600,400 -z 19.5 --level 0
@ -117,7 +117,7 @@ map-machine render -c 4.5978,-74.07507 -s 600,400 -z 19.5 --level 0
### Shape combination ###
One of the key features of Map Machine is constructing icons from the several shapes.
One of the key features of Map Machine is constructing icons from several shapes.
#### Masts ####
@ -152,9 +152,9 @@ Installation
Requirements: Python 3.9.
* Install [cairo 2D graphic library](https://www.cairographics.org/download/),
* install [GEOS library](https://libgeos.org),
* install Python packages with the command:
* Install the [cairo 2D graphic library](https://www.cairographics.org/download/),
* install the [GEOS library](https://libgeos.org),
* install the Python packages with the command:
```shell
pip install git+https://github.com/enzet/map-machine
@ -165,7 +165,7 @@ For more detailed instructions, see [instructions](doc/INSTALL.md).
Map generation
--------------
Command `render` is used to generate SVG map from OpenStreetMap data. You can run it using:
The `render` command is used to generate an SVG map from OpenStreetMap data. You can run it using:
```shell
map-machine render \
@ -183,18 +183,18 @@ map-machine render \
--output=out/esplanade_du_trocadéro.svg
```
will download OSM data to `cache/2.284,48.860,2.290,48.865.osm` and write an output SVG map of the specified area to `out/esplanade_du_trocadéro.svg`.
will download OSM data to `cache/2.284,48.860,2.290,48.865.osm` and render an SVG map of the specified area to `out/esplanade_du_trocadéro.svg`.
### Arguments ###
| Option | Description |
|---|---|
| <span style="white-space: nowrap;">`-i`</span>, <span style="white-space: nowrap;">`--input`</span> `<path>` | input XML file name or names (if not specified, file will be downloaded using OpenStreetMap API) |
| <span style="white-space: nowrap;">`-i`</span>, <span style="white-space: nowrap;">`--input`</span> `<path>` | input XML file name or names (if not specified, file will be downloaded using the OpenStreetMap API) |
| <span style="white-space: nowrap;">`-o`</span>, <span style="white-space: nowrap;">`--output`</span> `<path>` | output SVG file name, default value: `out/map.svg` |
| <span style="white-space: nowrap;">`-b`</span>, <span style="white-space: nowrap;">`--boundary-box`</span> `<lon1>,<lat1>,<lon2>,<lat2>` | geo boundary box; if the first value is negative, use `=` sign or enclose the value with quotes and use space before `-`, e.g. `-b=-84.752,39.504,-84.749,39.508` or `-b " -84.752,39.504,-84.749,39.508"` |
| <span style="white-space: nowrap;">`-b`</span>, <span style="white-space: nowrap;">`--boundary-box`</span> `<lon1>,<lat1>,<lon2>,<lat2>` | geo boundary box; if the first value is negative, use the `=` sign or enclose the value with quotes and prefix a space before `-`, e.g. `-b=-84.752,39.504,-84.749,39.508` or `-b " -84.752,39.504,-84.749,39.508"` |
| <span style="white-space: nowrap;">`--cache`</span> `<path>` | path for temporary OSM files, default value: `cache` |
| <span style="white-space: nowrap;">`-z`</span>, <span style="white-space: nowrap;">`--zoom`</span> `<float>` | OSM zoom level, default value: 18.0 |
| <span style="white-space: nowrap;">`-c`</span>, <span style="white-space: nowrap;">`--coordinates`</span> `<latitude>,<longitude>` | coordinates of any location inside the tile; if the first value is negative, use `=` sign or enclose the value with quotes and use space before `-`, e.g. `-c=-84.752,39.504` or `-c " -84.752,39.504"` |
| <span style="white-space: nowrap;">`-c`</span>, <span style="white-space: nowrap;">`--coordinates`</span> `<latitude>,<longitude>` | coordinates of any location inside the tile; if the first value is negative, use the `=` sign or enclose the value with quotes and prefix a space before `-`, e.g. `-c=-84.752,39.504` or `-c " -84.752,39.504"` |
| <span style="white-space: nowrap;">`-s`</span>, <span style="white-space: nowrap;">`--size`</span> `<width>,<height>` | resulted image size |
plus [map configuration options](#map-options)
@ -206,18 +206,18 @@ Command `tile` is used to generate PNG tiles for [slippy maps](https://wiki.open
| Option | Description |
|---|---|
| <span style="white-space: nowrap;">`-c`</span>, <span style="white-space: nowrap;">`--coordinates`</span> `<latitude>,<longitude>` | coordinates of any location inside the tile; if the first value is negative, use `=` sign or enclose the value with quotes and use space before `-`, e.g. `-c=-84.752,39.504` or `-c " -84.752,39.504"` |
| <span style="white-space: nowrap;">`-c`</span>, <span style="white-space: nowrap;">`--coordinates`</span> `<latitude>,<longitude>` | coordinates of any location inside the tile; if the first value is negative, use the `=` sign or enclose the value with quotes and prefix a space before `-`, e.g. `-c=-84.752,39.504` or `-c " -84.752,39.504"` |
| <span style="white-space: nowrap;">`-t`</span>, <span style="white-space: nowrap;">`--tile`</span> `<zoom level>/<x>/<y>` | tile specification |
| <span style="white-space: nowrap;">`--cache`</span> `<path>` | path for temporary OSM files, default value: `cache` |
| <span style="white-space: nowrap;">`-b`</span>, <span style="white-space: nowrap;">`--boundary-box`</span> `<lon1>,<lat1>,<lon2>,<lat2>` | construct the minimum amount of tiles that cover the requested boundary box; if the first value is negative, use `=` sign or enclose the value with quotes and use space before `-`, e.g. `-b=-84.752,39.504,-84.749,39.508` or `-b " -84.752,39.504,-84.749,39.508"` |
| <span style="white-space: nowrap;">`-b`</span>, <span style="white-space: nowrap;">`--boundary-box`</span> `<lon1>,<lat1>,<lon2>,<lat2>` | construct the minimum amount of tiles that cover the requested boundary box; if the first value is negative, use the `=` sign or enclose the value with quotes and prefix a space before `-`, e.g. `-b=-84.752,39.504,-84.749,39.508` or `-b " -84.752,39.504,-84.749,39.508"` |
| <span style="white-space: nowrap;">`-z`</span>, <span style="white-space: nowrap;">`--zoom`</span> `<range>` | OSM zoom levels; can be list of numbers or ranges, e.g. `16-18`, `16,17,18`, or `16,18-20`, default value: `18` |
| <span style="white-space: nowrap;">`-i`</span>, <span style="white-space: nowrap;">`--input`</span> `<path>` | input OSM XML file name (if not specified, the file will be downloaded using OpenStreetMap API) |
| <span style="white-space: nowrap;">`-i`</span>, <span style="white-space: nowrap;">`--input`</span> `<path>` | input OSM XML file name (if not specified, the file will be downloaded using the OpenStreetMap API) |
plus [map configuration options](#map-options)
### Generate one tile ###
Specify tile coordinates:
Specify the tile coordinates:
```shell
map-machine tile --tile <OSM zoom level>/<x>/<y>
@ -231,7 +231,7 @@ map-machine tile \
--zoom=<OSM zoom levels>
```
Tile will be stored as SVG file `out/tiles/tile_<zoom level>_<x>_<y>.svg` and PNG file `out/tiles/tile_<zoom level>_<x>_<y>.svg`, where `x` and `y` are tile coordinates. `--zoom` option will be ignored if it is used with `--tile` option.
The tile will be stored as an SVG file `out/tiles/tile_<zoom level>_<x>_<y>.svg` and a PNG file `out/tiles/tile_<zoom level>_<x>_<y>.svg`, where `x` and `y` are tile coordinates. The `--zoom` option will be ignored if it is used with the `--tile` option.
Example:
@ -239,11 +239,11 @@ Example:
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`.
will generate an SVG file `out/tiles/tile_18_158471_81953.svg` and a PNG file `out/tiles/tile_18_158471_81953.png`.
### Generate a set of tiles ###
Specify boundary box to get the minimal set of tiles that covers the area:
Specify the boundary box to get the minimal set of tiles that covers the area:
```shell
map-machine tile \
@ -251,7 +251,7 @@ map-machine tile \
--zoom=<OSM zoom levels>
```
The boundary box will be extended to the boundaries of the minimal tileset that covers the area, then it will be extended a bit more to avoid some artifacts on the edges rounded to 3 digits after the decimal point. Map with new boundary box coordinates will be written to the cache directory as SVG and PNG files. All tiles will be stored as SVG files `out/tiles/tile_<zoom level>_<x>_<y>.svg` and PNG files `out/tiles/tile_<zoom level>_<x>_<y>.svg`, where `x` and `y` are tile coordinates.
The boundary box will be extended to the boundaries of the minimal tileset that covers the area, then it will be extended a bit more to avoid some artifacts on the edges rounded to 3 digits after the decimal point. The map with the new boundary box coordinates will be written to the cache directory as SVG and PNG files. All tiles will be stored as SVG files `out/tiles/tile_<zoom level>_<x>_<y>.svg` and PNG files `out/tiles/tile_<zoom level>_<x>_<y>.svg`, where `x` and `y` are tile coordinates.
Example:
@ -264,7 +264,7 @@ will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the wa
Tile server
-----------
Command `server` is used to run tile server for slippy maps.
The `server` command is used to run a tile server for slippy maps.
```shell
map-machine server
@ -338,9 +338,9 @@ Map configuration options used by `render` and `tile` commands:
MapCSS 0.2 generation
---------------------
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.
The `mapcss` command can be used to generate a MapCSS scheme. `map-machine mapcss` will create an `out/map_machine_mapcss` directory with simple MapCSS 0.2 scheme adding icons from the Röntgen icon set to nodes and areas: `.mapcss` file and directory with icons.
To create MapCSS with Map Machine style also for ways and relations, run `map-machine mapcss --ways`.
To create a MapCSS style with Map Machine style also for ways and relations, run `map-machine mapcss --ways`.
| Option | Description |
|---|---|
@ -357,13 +357,13 @@ To create MapCSS with Map Machine style also for ways and relations, run `map-ma
* Active styles: press <kbd>+</kbd>.
* URL / File: set path to `out/map_machine_mapcss/map_machine.mapcss`.
To enable/disable Map Machine map paint style go to <kbd>View</kbd><kbd>Map Paint Styles</kbd><kbd>Map Machine</kbd>.
To enable/disable the Map Machine map paint style go to <kbd>View</kbd><kbd>Map Paint Styles</kbd><kbd>Map Machine</kbd>.
#### Example ####
![JOSM example](doc/josm.png)
Example of using Röntgen icons on top of Mapnik style in JOSM. Map Paint Styles look like this:
Example of using Röntgen icons on top of the Mapnik style in JOSM. Map Paint Styles look like this:
* ✓ Mapnik (true)
* ✓ Map Machine

View file

@ -1,13 +1,13 @@
\title {Map Machine}
\b {Map Machine} project consists of
The \b {Map Machine} project consists of
\list
{Python \ref {http://openstreetmap.org} {OpenStreetMap} renderer:
{a Python \ref {http://openstreetmap.org} {OpenStreetMap} renderer:
\list
{SVG \ref {#map-generation} {map generation},}
{SVG and PNG \ref {#tile-generation} {tile generation},}}
{\ref {#röntgen-icon-set} {Röntgen} icon set\: unique CC-BY 4.0 map icons.}
{the \ref {#röntgen-icon-set} {Röntgen} icon set\: unique CC-BY 4.0 map icons.}
The idea behind the Map Machine project is to \b {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 both for map contributors\: to display all changes one made on the map even if they are small, and for map users\: to dig down into the map and find every detail that was mapped.
@ -25,15 +25,15 @@ See
\code {shell} {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 \m {out/map.svg}. See \ref {#map-generation} {Map generation}.
will automatically download OSM data and render an SVG map of the specified area to \m {out/map.svg}. See \ref {#map-generation} {Map generation}.
\code {shell} {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 the \m {out/tiles} directory. See \ref {#tile-generation} {Tile generation}.
will automatically download OSM data and render PNG tiles that cover the specified area to the \m {out/tiles} directory. See \ref {#tile-generation} {Tile generation}.
\2 {Röntgen icon set} {röntgen-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 specially created for Map Machine project. 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.
The central feature of the project is the Röntgen icon set. It is a set of monochrome 14 × 14 px pixel-aligned icons specially created for the Map Machine project. Unlike the Map Machine source code, which is under the MIT license, all icons are under the \ref {http://creativecommons.org/licenses/by/4.0/} {CC BY} license. So, with the appropriate credit the icon set can be used outside the project. Some icons can be used as emoji symbols.
All icons tend to support a 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}.
@ -41,13 +41,13 @@ All icons tend to support a common design style, which is heavily inspired by \r
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 the final goal is to cover all tags. However, commonly used tags have priority, other things being equal.
Generate icon grid and sets of individual icons with \m {\command {icons}}. It will update \m {doc/grid.svg} file, and create SVG files in \m {out/icons_by_id} directory where files are named using shape identifiers (e.g. \m {power_tower_portal_2_level.svg}) and in \m {icons_by_name} directory where files are named using shape names (e.g. \m {Röntgen portal two-level transmission tower.svg}). Files from the last directory are used in OpenStreetMap wiki (e.g. \ref {https://wiki.openstreetmap.org/wiki/File:R%C3%B6ntgen_portal_two-level_transmission_tower.svg} {\m {File:Röntgen_portal_two-level_transmission_tower.svg}}).
Generate an icon grid and sets of individual icons with \m {\command {icons}}. It will update the \m {doc/grid.svg} file, and create SVG files in the \m {out/icons_by_id} directory where files are named using shape identifiers (e.g. \m {power_tower_portal_2_level.svg}) and in the \m {icons_by_name} directory where files are named using shape names (e.g. \m {Röntgen portal two-level transmission tower.svg}). Files from the last directory are used in the OpenStreetMap wiki (e.g. \ref {https://wiki.openstreetmap.org/wiki/File:R%C3%B6ntgen_portal_two-level_transmission_tower.svg} {\m {File:Röntgen_portal_two-level_transmission_tower.svg}}).
\2 {Map features} {map-features}
\3 {Extra icons} {extra-icons}
Map Machine uses icons to visualize tags for nodes and areas. But 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}).
Map Machine uses icons to visualize tags for nodes and areas. But unlike other renderers, Map Machine can use more than one icon to visualize an entity and can use colors to visualize \osm {colour} value or other entity properties (like \osm {material} or \osm {genus}).
\3 {Isometric building shapes} {isometric-building-shapes}
@ -57,7 +57,7 @@ With \m {--buildings isometric} or \m {--buildings isometric-no-parts} (not set
\3 {Road lanes} {road-lanes}
To determine road width Map Machine uses the \osm {width} tag value or estimates it based on the \osm {lanes} value. If lane value is specified, it also draws lane separators. This map style is highly inspired by Christoph Hormann's post \ref {http://blog.imagico.de/navigating-the-maze-part-2/} {Navigating the Maze}.
To determine the road width Map Machine uses the \osm {width} tag value or estimates it based on the \osm {lanes} value. If lane value is specified, it also draws lane separators. This map style is highly inspired by Christoph Hormann's post \ref {http://blog.imagico.de/navigating-the-maze-part-2/} {Navigating the Maze}.
\image {doc/lanes.svg} {Road lanes}
@ -103,7 +103,7 @@ Visualize \osm {design} values used with \osm {power=tower} and \osm {power=pole
\3 {Colors} {colors}
Map icons have \osm {colour} tag value if it is present, otherwise, icons are displayed with dark grey color by default, purple color for shop nodes, red color for emergency features, and special colors for natural features. Map Machine also takes into account \osm {building:colour}, \osm {roof:colour} and other \m {*:colour} tags, and uses \osm {colour} tag value to paint subway lines.
Map icons have \osm {colour} tag value if it is present, otherwise, icons are displayed with dark grey color by default, purple color for shop nodes, red color for emergency features, and special colors for natural features. Map Machine also takes into account \osm {building:colour}, \osm {roof:colour} and other \m {*:colour} tags, and uses the \osm {colour} tag value to paint subway lines.
\image {doc/colors.svg} {Building colors}
@ -119,7 +119,7 @@ Japanese maps usually use \ref {https://en.wikipedia.org/wiki/List_of_Japanese_m
\3 {Indoor features} {indoor-features}
Draw indoor features specifying level with \m {--level} option. Possible values are numbers (e.g. \m {1}, \m {0.5}), lists of number separated by \m {;} (e.g. \m {1;2;4;4.5}), \m {all}, \m {overground}, and \m {underground}. Default value is not \m {all}, but \m {overground}, so underground objects are not shown on the map if \m {--level} option is not specified.
Draw indoor features specifying level with \m {--level} option. Possible values are numbers (e.g. \m {1}, \m {0.5}), lists of number separated by \m {;} (e.g. \m {1;2;4;4.5}), \m {all}, \m {overground}, and \m {underground}. The default value is not \m {all}, but \m {overground}, so underground objects are not shown on the map if \m {--level} option is not specified.
\code {shell} {map-machine render -c 4.5978,-74.07507 -s 600,400 -z 19.5 --level 0}
@ -127,7 +127,7 @@ Draw indoor features specifying level with \m {--level} option. Possible values
\3 {Shape combination} {shape-combination}
One of the key features of Map Machine is constructing icons from the several shapes.
One of the key features of Map Machine is constructing icons from several shapes.
/* Some icons consist of just one shape, to construct others it may be necessary to combine two or more shapes. */
@ -202,9 +202,9 @@ Every way and node displayed with the random color picked for each author with \
Requirements\: Python 3.9/* or higher*/.
\list
{Install \ref {https://www.cairographics.org/download/} {cairo 2D graphic library},}
{install \ref {https://libgeos.org} {GEOS library},}
{install Python packages with the command\:}
{Install the \ref {https://www.cairographics.org/download/} {cairo 2D graphic library},}
{install the \ref {https://libgeos.org} {GEOS library},}
{install the Python packages with the command\:}
\code {shell} {pip install git+https://github.com/enzet/map-machine}
@ -212,7 +212,7 @@ For more detailed instructions, see \ref {doc/INSTALL.md} {instructions}.
\2 {Map generation} {map-generation}
Command \m {render} is used to generate SVG map from OpenStreetMap data. You can run it using\:
The \m {render} command is used to generate an SVG map from OpenStreetMap data. You can run it using\:
\code {shell} {map-machine render \\
-b=\formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\
@ -226,7 +226,7 @@ Command \m {render} is used to generate SVG map from OpenStreetMap data. You ca
--boundary-box=2.284,48.860,2.290,48.865 \\
--output=out/esplanade_du_trocadéro.svg}
will download OSM data to \m {cache/2.284,48.860,2.290,48.865.osm} and write an output SVG map of the specified area to \m {out/esplanade_du_trocadéro.svg}.
will download OSM data to \m {cache/2.284,48.860,2.290,48.865.osm} and render an SVG map of the specified area to \m {out/esplanade_du_trocadéro.svg}.
\3 {Arguments} {arguments}
@ -244,7 +244,7 @@ plus \ref {#map-options} {map configuration options}
\3 {Generate one tile} {generate-one-tile}
Specify tile coordinates\:
Specify the tile coordinates\:
\code {shell} {map-machine tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}}
@ -254,23 +254,23 @@ or specify any geographical coordinates inside a tile\:
--coordinates=\formal {latitude},\formal {longitude} \\
--zoom=\formal {OSM zoom levels}}
Tile will be stored as SVG file \m {out/tiles/tile_<zoom level>_<x>_<y>.svg} and PNG file \m {out/tiles/tile_<zoom level>_<x>_<y>.svg}, where \m {x} and \m {y} are tile coordinates. \m {--zoom} option will be ignored if it is used with \m {--tile} option.
The tile will be stored as an SVG file \m {out/tiles/tile_<zoom level>_<x>_<y>.svg} and a PNG file \m {out/tiles/tile_<zoom level>_<x>_<y>.svg}, where \m {x} and \m {y} are tile coordinates. The \m {--zoom} option will be ignored if it is used with the \m {--tile} option.
Example\:
\code {shell} {map-machine tile -c=55.7510637,37.6270761 -z=18}
will generate SVG file \m {out/tiles/tile_18_158471_81953.svg} and PNG file \m {out/tiles/tile_18_158471_81953.png}.
will generate an SVG file \m {out/tiles/tile_18_158471_81953.svg} and a PNG file \m {out/tiles/tile_18_158471_81953.png}.
\3 {Generate a set of tiles} {generate-a-set-of-tiles}
Specify boundary box to get the minimal set of tiles that covers the area\:
Specify the boundary box to get the minimal set of tiles that covers the area\:
\code {shell} {map-machine tile \\
--boundary-box=\formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\
--zoom=\formal {OSM zoom levels}}
The boundary box will be extended to the boundaries of the minimal tileset that covers the area, then it will be extended a bit more to avoid some artifacts on the edges rounded to 3 digits after the decimal point. Map with new boundary box coordinates will be written to the cache directory as SVG and PNG files. All tiles will be stored as SVG files \m {out/tiles/tile_<zoom level>_<x>_<y>.svg} and PNG files \m {out/tiles/tile_<zoom level>_<x>_<y>.svg}, where \m {x} and \m {y} are tile coordinates.
The boundary box will be extended to the boundaries of the minimal tileset that covers the area, then it will be extended a bit more to avoid some artifacts on the edges rounded to 3 digits after the decimal point. The map with the new boundary box coordinates will be written to the cache directory as SVG and PNG files. All tiles will be stored as SVG files \m {out/tiles/tile_<zoom level>_<x>_<y>.svg} and PNG files \m {out/tiles/tile_<zoom level>_<x>_<y>.svg}, where \m {x} and \m {y} are tile coordinates.
Example\:
@ -280,7 +280,7 @@ will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the wa
\2 {Tile server} {tile-server}
Command \m {server} is used to run tile server for slippy maps.
The \m {server} command is used to run a tile server for slippy maps.
\code {shell} {map-machine server}
@ -325,9 +325,9 @@ 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 {mapcss}} 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.
The \m {mapcss} command can be used to generate a MapCSS scheme. \m {\command {mapcss}} will create an \m {out/map_machine_mapcss} directory with simple MapCSS 0.2 scheme adding icons from the Röntgen icon set to nodes and areas\: \m {.mapcss} file and directory with icons.
To create MapCSS with Map Machine style also for ways and relations, run \m {map-machine mapcss --ways}.
To create a MapCSS style with Map Machine style also for ways and relations, run \m {map-machine mapcss --ways}.
\options {mapcss}
@ -340,13 +340,13 @@ To create MapCSS with Map Machine style also for ways and relations, run \m {map
{Active styles: press \kbd {+}.}
{URL / File: set path to \m {out/map_machine_mapcss/map_machine.mapcss}.}
To enable/disable Map Machine map paint style go to \kbd {View} → \kbd {Map Paint Styles} → \kbd {Map Machine}.
To enable/disable the Map Machine map paint style go to \kbd {View} → \kbd {Map Paint Styles} → \kbd {Map Machine}.
\4 {Example} {example-3}
\image {doc/josm.png} {JOSM example}
Example of using Röntgen icons on top of Mapnik style in JOSM. Map Paint Styles look like this\:
Example of using Röntgen icons on top of the Mapnik style in JOSM. Map Paint Styles look like this\:
\list
{✓ Mapnik (true)}
{✓ Map Machine}

View file

@ -32,14 +32,15 @@ COMMANDS: list[str] = [
]
BOUNDARY_BOX_WARNING: str = (
"if the first value is negative, use `=` sign or enclose the value with "
"quotes and use space before `-`, e.g. `-b=-84.752,39.504,-84.749,39.508` "
'or `-b " -84.752,39.504,-84.749,39.508"`'
"if the first value is negative, use the `=` sign or enclose the value "
"with quotes and prefix a space before `-`, e.g. "
"`-b=-84.752,39.504,-84.749,39.508` or `-b "
'" -84.752,39.504,-84.749,39.508"`'
)
COORDINATES_WARNING: str = (
"if the first value is negative, use `=` sign or enclose the value with "
"quotes and use space before `-`, e.g. `-c=-84.752,39.504` or `-c "
'" -84.752,39.504"`'
"if the first value is negative, use the `=` sign or enclose the value "
"with quotes and prefix a space before `-`, e.g. `-c=-84.752,39.504` or "
'`-c " -84.752,39.504"`'
)
@ -253,7 +254,7 @@ def add_tile_arguments(parser: argparse.ArgumentParser) -> None:
dest="input_file_name",
metavar="<path>",
help="input OSM XML file name (if not specified, the file will be "
"downloaded using OpenStreetMap API)",
"downloaded using the OpenStreetMap API)",
)
@ -290,7 +291,7 @@ def add_render_arguments(parser: argparse.ArgumentParser) -> None:
metavar="<path>",
nargs="*",
help="input XML file name or names (if not specified, file will be "
"downloaded using OpenStreetMap API)",
"downloaded using the OpenStreetMap API)",
)
parser.add_argument(
"-o",