Use OpenStreetMap tiles as basemaps in python / matplotlib
Uses OpenStreetMap tiles, or other tile servers, to produce “basemaps” for use with matplotlib. Uses a SQLite database to cache the tiles, so you can experiment with map production without re-downloading the same tiles. Supports Open Data tiles from the UK Ordnance Survey.
pip install tilemapbase
or build from source:
python setup.py install
or directly from GitHub:
pip install https://github.com/MatthewDaws/TileMapBase/zipball/master
OpenStreetMap Data is “© OpenStreetMap contributors”, see http://www.openstreetmap.org/copyright
Please remember that tile set usage is subject to constraints: https://operations.osmfoundation.org/policies/tiles/
As of 25/05/2019 OSM requires a user agent for all requests, with a warning “Faking another app’s User-Agent WILL get you blocked.” We hence default to using “TileMapBase” as a user agent.
Ordnance Survery data
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.