This repository helps create your own artwork based on real geographic maps.
In short:
A python script converts a
.osmfile exported fromopenstreetmap.orgto a.svgfile.
The created .svg file is importable to laser cutter and engraver machines such as the xTool S1 40W laser machine.
![]() |
|---|
| Laser cut engraved map. |
![]() |
|---|
| Laser cut engraved map, using several layers of 3 mm and 1.5 mm lime plywood boards. |
Each building gets randomly assigned a colour, based on a set of colours defined in config.yaml.
![]() |
|---|
| The generated image is then printed on a alu dibond frame. |
![]() |
|---|
| The generated image is printed as a poster. |
osm_art can probably be used for 3d printing as well: the different layers (building, road, sea, ...) can be assigned a height, e.g. using blender.
go to https://www.openstreetmap.org/#map=15/48.32029/-4.25231
move and zoom to your zone of interest
select Export mode
click Manually select a different area and draw a box around your zone of interest
click Export to download (map.osm)
copy the coordinates of the selected area. For instance, highlight with the mouse and copy-paste:
48.35303
-4.26463
-4.21785
48.28679
place the downloaded map.osm to ignored/osm/map.osm.
rename if needed. I will rename it to my_map.osm for the example.
in config.yaml, set under projects the name of your osm file and the coordinates of the selected area:
nwesmeans "north-west-east-south", and should already be the correct order of the above highlighted-and-copy-pasted text:
projects:
my_map:
nwes: [48.35303, -4.26463, -4.21785, 48.28679]
height_cm: 24decide the size in cm of the width or the heigh. Do set only one of them!
- For instance
height_cm: 24
adjust config.yaml. In particular, decide which osm elements to keep and how to represent them. There are currently two predefined subsets:
- "for wood laser-engraving"
- "for digital artwork"
run python convert_osm_to_svg.py [PROJECT_NAME] where [PROJECT_NAME] is the name of your project (my_map in my example).
the script will create a ignored/res/my_map directory, with a svg (my_map.svg).
you can visualise this .svf your favourite program (e.g. web-browser or inkscape).
- You can also manually edit the .svg, for instance using
inkscape, to remove some elements that would be complicated to process for the laser cutter and engraver machine. - The goal of the python script is to avoid tedious manual editing as much as possible. But some adjustments may still be required.
the .svg can be imported directly to xTool Studio.
- If asked
The image is larger than the canvas. Scale down?answerNo, keep originial size. - The svg map may be outside the canvas. Just translate it to bring on the canvas. But no scaling is needed.
- In
Layer and object listyou can define the settings (Engrave/Cut) for each layer.
- Clone the repository
git clone https://github.com/chauvinSimon/osm_art.git
cd osm_art- Install using
uv
uv sync
source .ven/bin/activate- Verify installation
python -m unittest discover -s tests -p "*.py"- Try main script
python convert_osm_to_svg.py --helpHow to set the width of the elements like roads and rivers?
- in
config.yamluseosm/layer_configsection: set thestroke_widthparameter. - The unit is mm.
Can I engrave a correctly-scaled map-scale? 📏
- Yes, in the created
ignored/res/my_mapdirectory amy_map_scale_bar.svgis produced when runningconvert_osm_to_svg.py. - This .svg can directly be imported to
xTool Studio. - The scaling dimensions are printed when running
convert_osm_to_svg.py. For instance:
INFO:utils_osm:Original dimensions: 5,208m x 11,089m
INFO:utils_osm:Scaled dimensions: 113mm x 240mm
INFO:utils_osm:Scale factor: 1:46203
INFO:utils_osm:Scale: 1cm on map = 462.0m in reality
INFO:utils_osm:Scale: 1km in reality = 2.164cm on map
Can I retrieve the names present in the exported map?
- Yes. One application is to create wood tiles with names on it and paste them on the map.
- First run
python convert_osm_to_svg.py [PROJECT_NAME]with the--save_name_mapsflag- In the
ignored/res/my_mapdirectory it will save single map for each name (inindividual_maps). - The name categories to retrieve can be set in
config.yamlundername_categories. - Note: there may be duplicated names.
- Note: for large map areas or dense maps, there may be many names retrieved.
- In the
- Then go to
ignored/res/my_mapdirectory and editname_positions.yaml- Delete all names you do not want to keep.
- Finally run
python apply_name_selection.py [PROJECT_NAME]- It will consider all names present in
name_positions.yaml, add them toselected_names.txt - You can visualise their positions in
map_selected_names.svg
- It will consider all names present in
![]() |
|---|
| Left: all names are automatically retrieved. Middle: after selection. Right: the selected names are engraved on wood labels. |
What area size is appropriate?
- Wood engraving works best with small (~10 km² or less).
- Especially nice for seashore.
How to create the sea?
- When you import an .svg from OSM, many “lines” are actually polylines or grouped objects, which
Nodetool cannot edit until they are proper paths. - With the line selected, go to
Path → Object to Path(Shift+Ctrl+C). - Switch to the
Nodetool (N). - Click the line.
- You should now see small square nodes along the path.
How to close the path into a polygon for filling?
- With the Node tool:
- select both the start and end nodes (click while holding Shift).
- Press Shift+J → Join Selected Nodes.
How to split a path?
- Select the start node and the next node in the path (Shift+Click).
- In the Node tool toolbar, click “Break segment between two nodes” (icon looks like a small line breaking apart).
- Shortcut: Shift+B.
- This will open the path at that segment.
How to save a good-quality png?
- The best is probably to open in inkscape and export to png setting the DPI.
- Do binary search to determine the max resolution accepted by DM Fotoparadies.
- The limit is not strictly related to the file size: sometimes accepting 5MB, sometimes limited at 2.5MB.
How to add text?
- Press
T. - Not all fonts offer "bold" and "italic"
How to adjust the page size?
- Click on page icon (Document Properties).
- Adjust page dimension with
WidthandHeight. - Adjust top-left corner under
Viewbox.
Warning about sea: "sea-only" zones are cropped, whatever selection is done in https://www.openstreetmap.org/export.




