skillfed

staticmap

A small, python-based library for creating map images with lines and markers.

staticmap v0.5.7 180.2K downloads/30d#10,150 on PyPI331
License unclear Active released

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 staticmap

uv

uv add staticmap

poetry

poetry add staticmap

Installing 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

static map image generationdraw lines on mapmap markers and overlaysgeographic visualizationtile-based map renderingosm map imagepython map graphics
cartographygeospatialimage-generation

More Graphics packages