mirror of
https://github.com/enzet/map-machine.git
synced 2025-07-07 11:47:54 +02:00
Update documentation syntax for new Moire version.
In Moire `\code` tag is now has language, if exists, in its first argument. This was changed for better syntax highlighting support.
This commit is contained in:
parent
c5bee25391
commit
f6c49c7928
5 changed files with 42 additions and 40 deletions
27
README.md
27
README.md
|
@ -23,13 +23,13 @@ See
|
|||
Usage example
|
||||
-------------
|
||||
|
||||
```bash
|
||||
```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 `out/map.svg`. See [Map generation](#map-generation).
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine tile -b=2.361,48.871,2.368,48.875
|
||||
```
|
||||
|
||||
|
@ -157,7 +157,7 @@ Map generation
|
|||
|
||||
Command `render` is used to generate SVG map from OpenStreetMap data. You can run it using:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine render \
|
||||
-b=<min longitude>,<min latitude>,<max longitude>,<max latitude> \
|
||||
-o=<output file name> \
|
||||
|
@ -167,7 +167,7 @@ map-machine render \
|
|||
|
||||
### Example ###
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine render \
|
||||
--boundary-box=2.284,48.860,2.290,48.865 \
|
||||
--output=out/esplanade_du_trocadéro.svg
|
||||
|
@ -209,13 +209,13 @@ plus [map configuration options](#map-options)
|
|||
|
||||
Specify tile coordinates:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine tile --tile <OSM zoom level>/<x>/<y>
|
||||
```
|
||||
|
||||
or specify any geographical coordinates inside a tile:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine tile \
|
||||
--coordinates=<latitude>,<longitude> \
|
||||
--zoom=<OSM zoom levels>
|
||||
|
@ -225,7 +225,7 @@ Tile will be stored as SVG file `out/tiles/tile_<zoom level>_<x>_<y>.svg` and PN
|
|||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine tile -c=55.7510637,37.6270761 -z=18
|
||||
```
|
||||
|
||||
|
@ -235,7 +235,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
|
||||
```shell
|
||||
map-machine tile \
|
||||
--boundary-box=<min longitude>,<min latitude>,<max longitude>,<max latitude> \
|
||||
--zoom=<OSM zoom levels>
|
||||
|
@ -245,7 +245,7 @@ The boundary box will be extended to the boundaries of the minimal tileset that
|
|||
|
||||
Example:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
map-machine tile -b=2.361,48.871,2.368,48.875
|
||||
```
|
||||
|
||||
|
@ -256,7 +256,7 @@ Tile server
|
|||
|
||||
Command `server` is used to run tile server for slippy maps.
|
||||
|
||||
```
|
||||
```shell
|
||||
map-machine server
|
||||
```
|
||||
|
||||
|
@ -271,19 +271,19 @@ Stop server interrupting the process with <kbd>Ctrl</kbd> + <kbd>C</kbd>.
|
|||
|
||||
Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19:
|
||||
|
||||
```bash
|
||||
```shell
|
||||
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
|
||||
```shell
|
||||
map-machine server
|
||||
```
|
||||
|
||||
Use JavaScript code for [Leaflet](https://leafletjs.com/):
|
||||
|
||||
```js
|
||||
```javascript
|
||||
var map = L.map('mapid').setView([48.8555, 2.3655], 18);
|
||||
|
||||
L.tileLayer('http://127.0.0.1:8080/tiles/{z}/{x}/{y}', {
|
||||
|
@ -311,6 +311,7 @@ Map configuration options used by `render` and `tile` commands:
|
|||
|
||||
| Option | Description |
|
||||
|---|---|
|
||||
| <span style="white-space: nowrap;">`--scheme`</span> `<id> or <path>` | scheme identifier (look for `<id>.yml` file) or path to a YAML scheme file, default value: `default` |
|
||||
| <span style="white-space: nowrap;">`--buildings`</span> `<mode>` | building drawing mode: no, flat, isometric, isometric-no-parts, default value: `flat` |
|
||||
| <span style="white-space: nowrap;">`--mode`</span> `<string>` | map drawing mode: normal, author, time, white, black, default value: `normal` |
|
||||
| <span style="white-space: nowrap;">`--overlap`</span> `<integer>` | how many pixels should be left around icons and text, default value: 12 |
|
||||
|
|
|
@ -22,4 +22,5 @@ pip install git+https://github.com/enzet/map-machine
|
|||
```shell
|
||||
brew install cairo geos
|
||||
pip install git+https://github.com/enzet/map-machine
|
||||
```
|
||||
```
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ Thank you for your interest in the Map Machine project. Since the primary goal
|
|||
|
||||
❗ \b {IMPORTANT} ❗ Before committing please enable Git hooks:
|
||||
|
||||
\code {git config --local core.hooksPath data/githooks} {shell}
|
||||
\code {shell} {git config --local core.hooksPath data/githooks}
|
||||
|
||||
This will allow you to automatically check your commit message and code before committing and pushing changes. This will crucially speed up pull request merging and make Git history neat and uniform.
|
||||
|
||||
|
@ -18,7 +18,7 @@ Activate virtual environment. E.g. for fish shell, run \m {source venv/bin/acti
|
|||
|
||||
Install the project in editable mode:
|
||||
|
||||
\code {pip install -e .} {shell}
|
||||
\code {shell} {pip install -e .}
|
||||
|
||||
Install formatter, linter and test system\: \m {pip install black flake8 mypy pytest pytest-cov}.
|
||||
|
||||
|
|
|
@ -10,14 +10,14 @@ Map Machine requires \ref {https://www.python.org} {Python} 3.9, \ref {https://p
|
|||
|
||||
\3 {Ubuntu} {ubuntu}
|
||||
|
||||
\code {
|
||||
\code {shell} {
|
||||
apt install libcairo2-dev libgeos-dev
|
||||
pip install git+https://github.com/enzet/map-machine
|
||||
} {shell}
|
||||
}
|
||||
|
||||
\3 {macOS} {macos}
|
||||
|
||||
\code {
|
||||
\code {shell} {
|
||||
brew install cairo geos
|
||||
pip install git+https://github.com/enzet/map-machine
|
||||
} {shell}
|
||||
}
|
||||
|
|
|
@ -23,11 +23,11 @@ See
|
|||
|
||||
\2 {Usage example} {usage-example}
|
||||
|
||||
\code {map-machine render -b=2.284,48.860,2.290,48.865} {bash}
|
||||
\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}.
|
||||
|
||||
\code {map-machine tile -b=2.361,48.871,2.368,48.875} {bash}
|
||||
\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}.
|
||||
|
||||
|
@ -198,7 +198,7 @@ Requirements\: Python 3.9/* or higher*/.
|
|||
{install \ref {https://libgeos.org} {GEOS library},}
|
||||
{install Python packages with the command\:}
|
||||
|
||||
\code {pip install git+https://github.com/enzet/map-machine} {shell}
|
||||
\code {shell} {pip install git+https://github.com/enzet/map-machine}
|
||||
|
||||
For more detailed instructions, see \ref {doc/INSTALL.md} {instructions}.
|
||||
|
||||
|
@ -206,17 +206,17 @@ For more detailed instructions, see \ref {doc/INSTALL.md} {instructions}.
|
|||
|
||||
Command \m {render} is used to generate SVG map from OpenStreetMap data. You can run it using\:
|
||||
|
||||
\code {map-machine render \\
|
||||
\code {shell} {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} \\
|
||||
\formal {other arguments}} {bash}
|
||||
\formal {other arguments}}
|
||||
|
||||
\3 {Example} {example}
|
||||
|
||||
\code {map-machine render \\
|
||||
\code {shell} {map-machine render \\
|
||||
--boundary-box=2.284,48.860,2.290,48.865 \\
|
||||
--output=out/esplanade_du_trocadéro.svg} {bash}
|
||||
--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}.
|
||||
|
||||
|
@ -238,19 +238,19 @@ plus \ref {#map-options} {map configuration options}
|
|||
|
||||
Specify tile coordinates\:
|
||||
|
||||
\code {map-machine tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}} {bash}
|
||||
\code {shell} {map-machine tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}}
|
||||
|
||||
or specify any geographical coordinates inside a tile\:
|
||||
|
||||
\code {map-machine tile \\
|
||||
\code {shell} {map-machine tile \\
|
||||
--coordinates=\formal {latitude},\formal {longitude} \\
|
||||
--zoom=\formal {OSM zoom levels}} {bash}
|
||||
--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.
|
||||
|
||||
Example\:
|
||||
|
||||
\code {map-machine tile -c=55.7510637,37.6270761 -z=18} {bash}
|
||||
\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}.
|
||||
|
||||
|
@ -258,15 +258,15 @@ 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 {map-machine tile \\
|
||||
\code {shell} {map-machine tile \\
|
||||
--boundary-box=\formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\
|
||||
--zoom=\formal {OSM zoom levels}} {bash}
|
||||
--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.
|
||||
|
||||
Example\:
|
||||
|
||||
\code {map-machine tile -b=2.361,48.871,2.368,48.875} {bash}
|
||||
\code {shell} {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 \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}.
|
||||
|
||||
|
@ -274,7 +274,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 {map-machine server}
|
||||
\code {shell} {map-machine server}
|
||||
|
||||
Stop server interrupting the process with \kbd {Ctrl} + \kbd {C}.
|
||||
|
||||
|
@ -284,15 +284,15 @@ Stop server interrupting the 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 {map-machine tile -b=2.364,48.854,2.367,48.857 -z=16-19} {bash}
|
||||
\code {shell} {map-machine tile -b=2.364,48.854,2.367,48.857 -z=16-19}
|
||||
|
||||
Run tile server on 127.0.0.1\:8080\:
|
||||
|
||||
\code {map-machine server} {bash}
|
||||
\code {shell} {map-machine server}
|
||||
|
||||
Use JavaScript code for \ref {https://leafletjs.com/} {Leaflet}\:
|
||||
|
||||
\code {var map = L.map('mapid').setView([48.8555, 2.3655], 18);
|
||||
\code {javascript} {var map = L.map('mapid').setView([48.8555, 2.3655], 18);
|
||||
|
||||
L.tileLayer('http://127.0.0.1:8080/tiles/\{z\}/\{x\}/\{y\}', \{
|
||||
maxZoom: 19,
|
||||
|
@ -303,11 +303,11 @@ L.tileLayer('http://127.0.0.1:8080/tiles/\{z\}/\{x\}/\{y\}', \{
|
|||
id: 'map_machine',
|
||||
tileSize: 256,
|
||||
zoomOffset: 0
|
||||
\}).addTo(map);} {js}
|
||||
\}).addTo(map);}
|
||||
|
||||
HTML code\:
|
||||
|
||||
\code {<div id="mapid" style="width: 1000px; height: 600px;"></div>} {html}
|
||||
\code {html} {<div id="mapid" style="width: 1000px; height: 600px;"></div>}
|
||||
|
||||
\2 {Map options} {map-options}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue