marceloprates /prettymaps
Draw pretty maps from OpenStreetMap data! Built with osmnx +matplotlib + shapely
★ 14,339⑂ 733👁 91⑃ 61● 94▤ 10
+0
Daily
+19
Weekly
+33
Monthly
14,339
stars
733
forks
91
watchers
61
prs
94
issues
10
releases
README
prettymaps
A minimal Python library to draw customized maps from OpenStreetMap created using the osmnx, matplotlib, shapely and vsketch packages.
!
This work is licensed under a GNU Affero General Public License v3.0 (you can make commercial use, distribute and modify this project, but must disclose the source code with the license and copyright notice)
Note about crediting and NFTs:
- Please keep the printed message on the figures crediting my repository and OpenStreetMap (mandatory by their license).
- I am personally against NFTs for their environmental impact, the fact that they're a giant money-laundering pyramid scheme and the structural incentives they create for theft in the open source and generative art communities.
- I do not authorize in any way this project to be used for selling NFTs, although I cannot legally enforce it. Respect the creator.
- The AeternaCivitas and geoartnft projects have used this work to sell NFTs and refused to credit it. See how they reacted after being exposed: AeternaCivitas, geoartnft.
- I have closed my other generative art projects on Github and won't be sharing new ones as open source to protect me from the NFT community.
As seen on Hacker News:
!
prettymaps subreddit
Tutorial (marimo) · Google Colaboratory Demo
Installation
Install locally:
Install prettymaps with:
pip install prettymaps
Install on Google Colaboratory:
Install prettymaps with:
!pip install -e "git+https://github.com/marceloprates/prettymapsegg=prettymaps"
Then restart the runtime (Runtime - Restart Runtime) before importing prettymaps
Run front-end
After prettymaps is installed, you can run the front-end (streamlit) application from the prettymaps repository using:
streamlit run app.py
Tutorial
The full tutorial is at docs/tutorial.md — a markdown walkthrough with rendered images, the [Plot] dataclass fields, the layers/style parameters, presets, multiplot, hillshade, and keypoints.
!Heerhugowaard sample
Quick start:
python
import prettymaps
plot = prettymaps.plot('Stad van de Zon, Heerhugowaard, Netherlands')
| Resource | Where to find it |
|---|---|
| Full tutorial (markdown + images) | docs/tutorial.md |
| Interactive marimo notebook (runnable) | notebooks/tutorial.py |
| Open in Google Colab | Open in Colab |
| Streamlit front-end | streamlit run app.py |
Run the tutorial locally (marimo)
sh
Install marimo (already in requirements.txt)
pip install marimo
Open the notebook in your browser
marimo edit notebooks/tutorial.py
Customizing parameters
The most important prettymaps.plot() parameters are:
- layers — dict of OpenStreetMap layers to fetch.
- style — dict of matplotlib style parameters per layer.
- preset — load a JSON preset (e.g. 'default', 'minimal', 'macao', 'tijuca').
- circle / radius / dilate — boundary shape.
plot is a dataclass with geodataframes (per-layer GeoDataFrames), fig, and ax.
python
plot = prettymaps.plot(
'Praça Ferreira do Amaral, Macau',
circTop issues
#51Parts of water not mapped properly9 comments · 2021-09-05#27shapely.geos:TopologyException: depth mismatch at at 552100 52776005 comments · 2021-08-28#61Railways4 comments · 2021-09-15#8Error adding railway layer4 comments · 2021-08-25#50Chicago3 comments · 2021-09-03#150Overpass API max retries exceeded2 comments · 2026-08-01#18Support for OpenStreet Geo URI2 comments · 2021-08-26#158Bug: plot() returns Plot dataclass, not (fig, ax) — breaks documented usage pattern1 comments · 2026-08-21
Discussions
#112v1.0.00 comments · 2023-02-15#52Possible to use tags more dynamically?0 comments · 2021-09-05#35Welcome to prettymaps Discussions!0 comments · 2021-08-29
Latest release
v1.4.2 v1.4.2 2025-03-03Fixed error with credit message