Repository navigation
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Description of the problem
Hi everyone,
I just rerun a previously working pygmt code and now I cannot plot OpenStreetMap anymore with tilemap. The tiles are now showing an access blocked form OpenStreetMap (see added figure). I checked it with both PyGMT version 0.17.0 and the newest version 0.19.0. Also I tried to rerun the tile maps example (https://www.pygmt.org/v0.19.0/gallery/maps/tilemaps.html). And I still get the same message as for my own code. If I use alternatively a Cartopy script to plot OpenStreetMap it works, so it seems to be an PyGMT issue.
Based on the linked webpage, PyGMT encounters a General Block: https://wiki.openstreetmap.org/wiki/Blocked_tiles
I would be happy if you could check if this is also happening for you. Thank you!
Greetings
Sarah
.
Minimal Complete Verifiable Example
"""
Tile maps
=========
The :meth:`pygmt.Figure.tilemap` method allows to plot
tiles from a tile server or local file as a basemap or overlay.
"""
# %%
import contextily
import pygmt
from pygmt.params import Axis
fig = pygmt.Figure()
fig.tilemap(
region=[-157.84, -157.8, 21.255, 21.285],
projection="M12c",
# Set level of details (0-22)
# Higher levels mean a zoom level closer to the Earth's
# surface with more tiles covering a smaller
# geographic area and thus more details and vice versa
# Please note, not all zoom levels are always available
zoom=14,
# Use tiles from OpenStreetMap tile server
source="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
frame=Axis(annot=True, tick=True, grid=True),
)
fig.show()Full error message
Access blocked 403
App is not following the tile usage policy of OpenStreetMap's volunteer-run servers: osm.wiki/BlockedSystem information
PyGMT information:
version: v0.19.0
System information:
python: 3.14.6 | packaged by conda-forge | (main, Jul 24 2026, 16:09:24) [GCC 14.3.0]
executable: ~/.conda/envs/pygmt/bin/python
machine: Linux-6.12.0-160000.36-default-x86_64-with-glibc2.40
Dependency information:
numpy: 2.5.2
pandas: 3.0.5
xarray: 2026.7.0
packaging: 26.3
contextily: 1.7.1
geopandas: None
IPython: None
pyarrow: None
rioxarray: 0.23.0
gdal: 3.13.2
ghostscript: 10.07.1
GMT library information:
version: 6.7.0
padding: 2
share dir: ~/.conda/envs/pygmt/share/gmt
plugin dir: ~/.conda/envs/pygmt/lib/gmt/plugins
library path: ~/.conda/envs/pygmt/lib/libgmt.so
cores: 16
grid layout: rows
image layout:
Or:
PyGMT information:
version: v0.17.0
System information:
python: 3.13.9 | packaged by conda-forge | (main, Oct 16 2025, 10:31:39) [GCC 14.3.0]
executable: ~/conda/envs/seispy_env/bin/python
machine: Linux-6.12.0-160000.36-default-x86_64-with-glibc2.40
Dependency information:
numpy: 2.3.5
pandas: 2.2.3
xarray: 2025.11.0
packaging: 25.0
contextily: 1.7.0
geopandas: 1.1.1
IPython: 9.7.0
pyarrow: 21.0.0
rioxarray: 0.20.0
gdal: 3.10.2
ghostscript: 10.06.0
GMT library information:
version: 6.5.0
padding: 2
share dir: ~/conda/envs/seispy_env/share/gmt
plugin dir: ~/conda/envs/seispy_env/lib/gmt/plugins
library path: ~/conda/envs/seispy_env/lib/libgmt.so
cores: 16
grid layout: rows
image layout:
binary version: 6.5.0Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Aug 11, 2026
👋 Thanks for opening your first issue here!
Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.
seisman commentedon Aug 11, 2026
@SarahMelanieM Thank you for the detailed report. I can confirm the issue.
PR #4816 should fix the issue. I don't have time to read the OSM tile policy carefully yet, so #4816 is still WIP.
yvonnefroehlich commentedon Aug 11, 2026
At the time of releasing 0.19.0, the tile maps gallery example looked good and worked as expected. However, for the dev version of the documentation (https://www.pygmt.org/dev/gallery/maps/tilemaps.html) we now face exactly the issue you report. It looks like this is a very recent problem: In PR #4809 merged on Sunday, the tile maps gallery example still looks good (https://pygmt-dev--4809.org.readthedocs.build/en/4809/gallery/maps/tilemaps.html), but in #4805 merged on Monday, it fails with the reported issue (https://pygmt-dev--4805.org.readthedocs.build/en/4805/gallery/maps/tilemaps.html). Some details are at #4816 (comment).
seisman commentedon Aug 12, 2026
@SarahMelanieM As a temporary workaround, you can use
source="https://tile.openstreetmap.de/{z}/{x}/{y}.png"instead.weiji14 commentedon Aug 12, 2026
FYI, that might give you slightly different labels in some places, e.g. German names on top of the local language names. See https://mc.bbbike.org/mc/?num=2&mt0=mapnik&mt1=mapnik-german
You could take a look at other providers at https://wiki.openstreetmap.org/wiki/Raster_tile_providers (copy from the 'tiles url' column).
SarahMelanieM commentedon Aug 12, 2026
Thank you for your fast replies and the good workaround!