staticmap
A small, python-based library for creating map images with lines and markers.
What it is and what it does
StaticMap is a lightweight Python library for rendering geographic map images by compositing map tiles with drawn overlays. It fetches tiles from a tile server (defaulting to OpenStreetMap), then uses Pillow to composite lines, circle markers, polygons, and custom icon markers onto the base map. The library handles coordinate-to-pixel projection and tile fetching via requests, making it straightforward to generate static map images for web pages, reports, or batch processing without needing a full web mapping framework.
You create a StaticMap instance with desired dimensions, add geographic features (lines between coordinates, markers at points, filled polygons), and call render() to get a PIL Image object. The library is designed for simple, single-image use cases—showing a route, marking locations, or visualizing geographic data as a PNG or other image format. It depends on Pillow for image manipulation and requests for HTTP tile fetching.
Use it for:
- Generate a static map image showing a route or journey between two cities for embedding in a report or email.
- Create a map with markers pinpointing store locations or event venues for a web page or printed flyer.
- Visualize geographic data (e.g., sensor readings, delivery points) as an overlay on a map tile for batch processing.
- Build a simple map preview for a travel or logistics application without deploying a full interactive mapping service.
- Render a polygon boundary (e.g., a service area or administrative region) on a map tile for documentation or analysis.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates static map images with geographic lines, markers, and polygons by fetching tiles from a map server and compositing them with Pillow.
Yes, if you need to generate simple static map images programmatically. Low install friction, no security vulnerabilities, and active maintenance make it a straightforward choice. Caveat: verify the license treatment before use in proprietary work, since the fact sheet does not confirm the Apache 2.0 claim. Not suitable if you need interactive maps or real-time map updates.
Install
staticmap on PyPI
pip
pip install staticmapuv
uv add staticmappoetry
poetry add staticmapInstalling staticmap
Before you install
Low friction: pure Python wheel with only three runtime dependencies (Pillow, requests, futures). Actively maintained with recent commits; last release was 2023-08-01 but repo shows activity as of 2026-07-31.
License in practice
License treatment is unclear—the description states Apache License 2.0, but the fact sheet records no SPDX identifier or raw license field. Verify the actual license before use in proprietary or GPL-licensed projects.
Quickstart
pip install staticmap
from staticmap import StaticMap, Line
m = StaticMap(300, 400, 10)
m.add_line(Line(((13.4, 52.5), (2.3, 48.9)), 'blue', 3))
image = m.render()
image.save('map.png')
Verify before relying
- Actual license SPDX identifier and whether it is truly Apache 2.0 as stated in the description
- Minimum Python version requirement (listed as unspecified in fact sheet)
- Whether futures dependency is needed for Python 3.x (it is typically a backport for Python 2)
Package facts
| License | not declared (unclear) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Pillow, requests, futures |
| Maintenance | actively maintained — 1,109 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 180,201/month — #10,150 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: staticmap-0.5.7-py3-none-any.whl
Keywords: static, map, image, osm
Tags
More Graphics packages
Pillow adds image processing capabilities to…
permissive · top 100 on PyPI
fonttoolsfonttools manipulates font files in multiple…
permissive · top 1,000 on PyPI
matplotlib-inlineEnables matplotlib figures to display inline…
permissive · top 1,000 on PyPI
pymupdfPyMuPDF extracts, renders, converts, and…
agpl · top 1,000 on PyPI
pypdfium2pypdfium2 is a Python binding to PDFium that…
permissive · top 1,000 on PyPI
altairAltair is a declarative Python library for…
permissive · top 1,000 on PyPI
pyGeoTileConverts between geographic coordinate systems…
permissive · top 15,000 on PyPI
polylineEncodes and decodes geographic coordinate…
unclear · top 5,000 on PyPI
osm2geojsonConverts OpenStreetMap and Overpass API data…
permissive · top 15,000 on PyPI
geosGEOS is a web server for creating and viewing…
copyleft · top 15,000 on PyPI
contextilyContextily retrieves tile-based map imagery…
permissive · top 15,000 on PyPI
quickchart.ioGenerates static chart images by encoding…
permissive · top 15,000 on PyPI
CartopyCartopy makes it easy to draw maps for data…
permissive · top 5,000 on PyPI
mapboxA Python client library for Mapbox web…
permissive · top 15,000 on PyPI
simplekmlSimplekml generates KML (Keyhole Markup…
copyleft · top 15,000 on PyPI
pycolmapPyCOLMAP exposes Python bindings to COLMAP's…
permissive · top 15,000 on PyPI