map-machine/doc/readme.moi
2021-08-03 02:54:06 +03:00

212 lines
7.8 KiB
Text

\b {Röntgen} (or \b {Roentgen} when ASCII is preferred) project consists of
\list
{simple Python \ref {http://openstreetmap.org} {OpenStreetMap} renderer (see \ref {#usage} {usage}, \ref {#map-generation} {renderer documentation}),}
{\ref {#icon-set} {set of CC-BY 4.0 icons} that can be used outside the project.}
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.
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.
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.
\2 {Usage} {usage}
To get SVG map, just run
\code {python roentgen.py render -b <lon1>,<lat1>,<lon2>,<lat2>} {bash}
(e.g. \m {python roentgen.py render -b 2.284,48.86,2.29,48.865}). It will automatically download OSM data and write output map to \m {out/map.svg}. For more options see \ref {#map-generation} {Map generation}.
\2 {Map features} {features}
Röntgen 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,}
{use color to visualize \osm {colour} and other features like plant types,}
{display \ref {#levels} {privitive 3D shapes} for buildings,}
{display \ref {#direction} {directions} with gradient sectors,}
{use width to display roads.}
\3 {Simple building shapes} {levels}
Simple shapes for walls and shade in proportion to \osm {building:levels}, \osm {building:min_level}, \osm {height} and \osm {min_height} values.
\image {doc/buildings.png} {3D buildings}
\3 {Trees} {trees}
Visualization of tree leaf types (broadleaved or needleleaved) and genus or taxon by means of icon shapes and leaf cycles (deciduous or evergreen) by means of color.
/*
\table
{{\osm {natural=tree}} {\icon {tree}}}
{{\osm {leaf_type=broadleaved}} {\icon {tree_with_leaf}}}
{{\osm {leaf_type=needleleaved}} {\icon {needleleaved_tree}}}
{{\osm {taxon=Arecaceae}} {\icon {palm}}}
{{\osm {genus=Betula}} {\icon {betula}}}
\table
{{} {\color {#98AC64}}}
{{\osm {leaf_cycle=deciduous}} {\color {#fcaf3e}}}
{{\osm {leaf_cycle=evergreen}} {\color {#688C44}}}
*/
\image {doc/trees.png} {Trees}
\3 {Viewpoint and camera direction} {direction}
Visualize \osm {direction} tag for \osm {tourism=viewpoint} and \osm {camera:direction} for \osm {man_made=surveillance}.
\image {doc/surveillance.png} {Surveillance}
\3 {Power tower design} {power-tower-design}
Visualize \osm {design} values used with \osm {power=tower} tag.
\image {doc/power_tower_design.png} {Power tower design}
\image {doc/power.png} {Power tower design}
\3 {Emergency} {emergency}
\image {doc/emergency.png} {Emergency}
\3 {Japanese map symbols} {japanese-map-symbols}
There are \ref {https://en.wikipedia.org/wiki/List_of_Japanese_map_symbols} {special symbols} appearing on Japanese maps.
\image {doc/japanese.png} {Japanese map symbols}
\2 {Icon set} {icon-set}
If tag is drawable it is displayed using icon combination and colors. All icons are under \ref {http://creativecommons.org/licenses/by/4.0/} {CC BY} license. So, do whatever you want but give appropriate credit. Icon set 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} icon sets.
\image {doc/grid.png} {Icons}
Feel free to request new icons via issues for whatever you want to see on the map. No matter how frequently the tag is used in OpenStreetMap since final goal is to cover all tags. However, common used tags have priority, other things being equal.
Generate icon grid and sets of individual icons with \m {\command {Test icon generation}}. It will create \m {out/icon_grid.svg} file, and 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}}).
\3 {Icon combination} {icon_combination}
Some icons can be combined into new icons.
\image {doc/bus_stop.png} {Bus stop icon combination}
/*
\3 {Icon settings} {icon_settings}
\4 {Japanese map symbols} {japanese-map-symbols}
\table
{
{}
{\code {\{
include: ['world'],
exclude: ['jp']
\}} (\ref {https://ideditor.github.io/location-conflation/?locationSet=%7Binclude%3A%20%5B%27world%27%5D%2C%20exclude%3A%20%5B%27jp%27%5D%7D&referrer=nsi} {view map})}
{\code {\{
include: ['jp']
\}} (\ref {https://ideditor.github.io/location-conflation/?locationSet=%7Binclude%3A%20%5B%27jp%27%5D%7D&referrer=nsi} {view map})}
}
{
{\m {amenity=post_office}}
{\icon {envelope} {-}}
{\icon {japan_post} {-}}
}
{
{\m {amenity=school}} {}
{\icon {japan_elementary_school} {-}}
}
\4 {Script direction} {script-direction}
Countries with right-to-left script direction\:
\code {\{include: [
'ae', 'af', 'bh', 'eg', 'il', 'iq', 'ir', 'jo', 'kw', 'lb', 'om', 'pk',
'ps', 'qa', 'sa', 'sy', 'ye'
]\}}
*/
\2 {Map styles} {map-styles}
\3 {All tags style} {all_tags_style}
Options\: \m {--show-missing-tags --overlap 0}.
Display as many OpenStreetMap data tags on the map as possible.
\3 {Pretty style} {pretty_style}
Options\: \m {--draw-captions main --level overground}.
Display only not overlapping icons and main captions.
\3 {Creation time mode} {time_mode}
Visualize element creation time with \m {--mode time}.
\image {doc/time.png} {Creation time mode}
\3 {Author mode} {autor_mode}
Every way and node displayed with the random color picked for each author with \m {--mode user-coloring}.
\image {doc/user.png} {Author mode}
\2 {Installation} {installation}
Requirements\: Python (at least 3.8).
To install all packages, run\:
\code {pip install -r requirements.txt} {bash}
\2 {Map generation} {map-generation}
Command\: \m {render}.
There are simple Python renderer that generates SVG map from OpenStreetMap data. You can run it using\:
\code {python roentgen.py render \\
-b $\{LONGITUDE_1\},$\{LATITUDE_1\},$\{LONGITUDE_2\},$\{LATITUDE_2\} \\
-o $\{OUTPUT_FILE_NAME\} \\
-s $\{OSM_ZOOM_LEVEL\}} {bash}
Example\:
\code {python roentgen.py render -b 2.284,48.86,2.29,48.865} {bash}
\3 {Arguments} {arguments}
\options {render}
\2 {Tile generation} {tile-generation}
Command\: \m {tile}.
\options {tile}
\code {python roentgen.py tile \\
-c $\{LATITUDE\},$\{LONGITUDE\} \\
-s $\{OSM_ZOOM_LEVEL\}} {bash}
Tile will be stored as SVG file to \m {out/tiles/tile_<zoom level>_<x>_<y>.svg}, where \m {x} and \m {y} are tile coordinates.
Example\:
\code {python roentgen.py tile -c 55.7510637,37.6270761 -s 18} {bash}
will generate SVG file \m {out/tiles/tile_18_158471_81953.svg}.
\2 {MapCSS 0.2 generation} {mapcss-0-2-generation}
Command\: \m {mapcss}.
\m {python roentgen.py mapcss} will create \m {out/roentgen_icons_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.