Registry / data / staticmap

staticmap

JSON →
library0.5.7pypypi✓ verified 83d ago

A small, Python-based library for creating static map images with lines and markers. Current version 0.5.7 (last released March 2020). Development appears to be in maintenance mode with no recent releases.

pip install staticmap
INSTALL
IMPORT
SIG · STATICMAP
S
staticmap
datapythonv0.5.7
Install
2.8s avg
Import
656ms
Disk
39MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.702s · 40.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.8s · import 0.610s · 41MB
39MB installed
● package 39MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StaticMap
from staticmap import StaticMap
Correct import path
CircleMarker
from staticmap import CircleMarker
Line
from staticmap import Line

Creates a map with a marker and a line, saved to map.png.

from staticmap import StaticMap, CircleMarker, Line m = StaticMap(600, 400, url_template='https://tile.openstreetmap.org/{z}/{x}/{y}.png') marker = CircleMarker((13.405, 52.52), 'blue', 12) m.add_marker(marker) line = Line([(13.4, 52.5), (13.41, 52.53)], 'red', 2) m.add_line(line) image = m.render() image.save('map.png')
Debug
Known issues
gotchaCoordinates are (lon, lat) order, not (lat, lon). Many users incorrectly pass (lat, lon) leading to markers in wrong locations.
fix
Always pass (longitude, latitude) to StaticMap, CircleMarker, and Line.
affects: all
gotchaTile fetching requires an internet connection. Offline usage is not supported natively.
fix
Ensure network access or pre-download tiles manually.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'staticmap'
Library not installed or installed in wrong environment.
fix
Run: pip install staticmap
TypeError: argument of type 'NoneType' is not iterable
Tile URL template is not set or tiles cannot be fetched.
fix
Specify a valid url_template: m = StaticMap(600, 400, url_template='https://tile.openstreetmap.org/{z}/{x}/{y}.png')
Upgrade
Version history
0.5.7latest on PyPI · released Aug 1, 2023
Audit
Dependencies
PillowrequiredImage manipulation backend
requestsrequiredDownloading map tiles
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
staticmap — pip install staticmap · libregistry