.github | ||
data/githooks | ||
doc | ||
icons | ||
roentgen | ||
scheme | ||
test | ||
.gitattributes | ||
.gitignore | ||
LICENSE | ||
README.md | ||
requirements.txt | ||
roentgen.py | ||
setup.py |
Röntgen (or Roentgen when ASCII is preferred) project consists of
- simple Python OpenStreetMap renderer and tile generator (see usage, renderer documentation, tile generation),
- set of CC-BY 4.0 icons that can be used outside the project.
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.
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.
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.
Usage example
roentgen 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.
roentgen 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.
Map features
Röntgen features:
- detailed icons to display subtypes like power tower design,
- can display multiple icons for one entity to cover more features,
- use color to visualize
colour
and other features like plant types, - display primitive 3D shapes for buildings,
- display directions with gradient sectors,
- use width to display roads.
Isometric building shapes
Isometric shapes for walls and shade in proportion to building:levels
, building:min_level
, height
and min_height
values.
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.
Viewpoint and camera direction
Visualize direction
tag for tourism
=viewpoint
and camera:direction
for man_made
=surveillance
.
Power tower design
Visualize design
values used with power
=tower
tag.
Emergency
Japanese map symbols
There are special symbols appearing on Japanese maps.
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 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, Osmic, and 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
value or other entity properties (like material
or genus
).
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
).
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.
Wireframe view
Creation time mode
Visualize element creation time with --mode time
.
Author mode
Every way and node displayed with the random color picked for each author with --mode user-coloring
.
Installation
Requirements: Python 3.9.
To install all packages, run:
pip install -r requirements.txt
pip install .
Map generation
Command render
is used to generates SVG map from OpenStreetMap data. You can run it using:
roentgen render \
-b <min longitude>,<min latitude>,<max longitude>,<max latitude> \
-o <output file name> \
-s <osm zoom level> \
<other arguments>
Example
roentgen render \
--boundary-box 2.284,48.860,2.290,48.865 \
--output out/esplanade_du_trocadéro.svg
will download OSM data to cache/2.284,48.860,2.290,48.865.osm
and write output SVG map of the specified area to out/esplanade_du_trocadéro.svg
.
Arguments
Option | Description |
---|---|
-i , --input <path> |
input XML file name or names (if not specified, file will be downloaded using OpenStreetMap API) |
-o , --output <path> |
output SVG file name, default value: out/map.svg |
-b , --boundary-box <lon1>,<lat1>,<lon2>,<lat2> |
geo boundary box; if first value is negative, enclose the value with quotes and use space before - |
--cache <path> |
path for temporary OSM files, default value: cache |
--seed <string> |
seed for random |
Tile generation
Command tile
is used to generate PNG tiles for slippy maps. To use them, run Röntgen tile server.
Option | Description |
---|---|
-c , --coordinates <latitude>,<longitude> |
coordinates of any location inside the tile |
-t , --tile <scale>/<x>/<y> |
tile specification |
--cache <path> |
path for temporary OSM files, default value: cache |
-b , --boundary-box <lon1>,<lat1>,<lon2>,<lat2> |
construct the minimum amount of tiles that cover requested boundary box |
Generate one tile
Specify tile coordinates:
roentgen tile --tile <OSM zoom level>/<x>/<y>
or specify any geographical coordinates inside a tile:
roentgen tile \
--coordinates <latitude>,<longitude> \
--scale <OSM zoom level>
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. --scale
option will be ignored if it is used with --tile
option.
Example:
roentgen tile -c 55.7510637,37.6270761 -s 18
will generate SVG file out/tiles/tile_18_158471_81953.svg
and 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:
roentgen tile \
--boundary-box <min longitude>,<min latitude>,<max longitude>,<max latitude> \
--scale <OSM zoom level>
Boundary box will be extended to the boundaries of the minimal tile set 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.
Example:
roentgen tile -b 2.361,48.871,2.368,48.875
will generate 36 PNG tiles at scale 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
.
Tile server
Command server
is used to run tile server for slippy maps.
roentgen server
Stop server interrupting process with Ctrl + C.
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.
To create MapCSS with Röntgen style also for ways and relations, run roentgen mapcss --ways
.
Option | Description |
---|---|
--icons |
add icons for nodes and areas, set by default |
--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
- Run
roentgen mapcss
. - Open JOSM.
- Go to Preferences → Third tab on the left → Map Paint Styles.
- Active styles: press +.
- URL / File: set path to
out/roentgen_mapcss/roentgen.mapcss
.
To enable / disable Röntgen map paint style go to View → Map Paint Styles → Röntgen.
Example
Example of using Röntgen icons on top of Mapnik style. Map Paint Styles:
- ✓ Mapnik
- ✓ Röntgen