Figure.tilemap/pygmt.datasets.tile_map: Set User-Agent to avoid blocked access to OSM tile server - #4816
Figure.tilemap/pygmt.datasets.tile_map: Set User-Agent to avoid blocked access to OSM tile server#4816seisman wants to merge 1 commit into
Conversation
…g OSM tile policy
fa1927b to
0f25ab6
Compare
|
Ping @GenericMappingTools/pygmt-maintainers for reviewing this PR. Related but slightly off-topic: |
This seems to be a quite new issue: In PR #4809 merged on Sunday the tile maps gallery example looks good (https://pygmt-dev--4809.org.readthedocs.build/en/4809/gallery/maps/tilemaps.html), but in #4805 merged on Monday it fails and shows the reported issue (https://pygmt-dev--4805.org.readthedocs.build/en/4805/gallery/maps/tilemaps.html) . Looking at the wikipedia pages for openstreetmap there are quite recent updates, https://wiki.openstreetmap.org/w/index.php?title=Blocked_tiles&action=history and https://wiki.openstreetmap.org/w/index.php?title=Referer&action=history.
With the changes in this PR the tile maps gallery example seems to work again, including when building the documentation locally. I am wondering if our weekly Link-Checks on Sundays can catch this. Maybe we should add a note to the release checklist to manually check this gallery example shortly before making a new release.
I am afraid yes. This issue affects all PyGMT versions, i.e. using a lower version does not work as an (unelegant) workaround. Thus, the |
Not sure why it worked before, but it turns out that now we need to set "User-Agent" when requesting tiles from the OSM tile server.
This PR sets the default User-Agent to something like
PyGMT/v0.19.0 (+https://www.pygmt.org)and allows custom headers.Reference:
Closes #4815.
Preview: