From 99a20a08e8d33a40682e30526ef1091af3511d9f Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:08:00 +1300 Subject: [PATCH 1/2] Switch away from Stamen basemaps Stamen basemaps are being deprecated, so switching the default source to OpenStreetMap Humanitarian web tiles following contextily. Changed load_tile_map's inline example to use OpenTopoMap, and tilemap gallery example to use USGS's USImageryTopo instead. --- examples/gallery/maps/tilemaps.py | 4 ++-- pygmt/datasets/tile_map.py | 6 +++--- pygmt/src/tilemap.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/gallery/maps/tilemaps.py b/examples/gallery/maps/tilemaps.py index 3eb8fc0055a..2f052eca6de 100644 --- a/examples/gallery/maps/tilemaps.py +++ b/examples/gallery/maps/tilemaps.py @@ -37,8 +37,8 @@ fig.tilemap( region=[-157.84, -157.8, 21.255, 21.285], projection="M12c", - # Use the Stamen.Watercolor option from contextily - source=contextily.providers.Stamen.Watercolor, + # Use the U.S. Geological Survey Imagery Topo web tiles from contextily + source=contextily.providers.USGS.USImageryTopo, frame="afg", ) diff --git a/pygmt/datasets/tile_map.py b/pygmt/datasets/tile_map.py index 928df7bb9be..cb75ea58bb3 100644 --- a/pygmt/datasets/tile_map.py +++ b/pygmt/datasets/tile_map.py @@ -50,8 +50,8 @@ def load_tile_map(region, zoom="auto", source=None, lonlat=True, wait=0, max_ret :class:`xyzservices.TileProvider` object. See :doc:`Contextily providers ` for a list of tile providers [Default is - ``xyzservices.providers.Stamen.Terrain``, i.e. Stamen Terrain web - tiles]. + ``xyzservices.providers.OpenStreetMap.HOT``, i.e. OpenStreetMap + Humanitarian web tiles]. - A web tile provider in the form of a URL. The placeholders for the XYZ in the URL need to be {x}, {y}, {z}, respectively. E.g. ``https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png``. @@ -96,7 +96,7 @@ def load_tile_map(region, zoom="auto", source=None, lonlat=True, wait=0, max_ret >>> raster = load_tile_map( ... region=[-180.0, 180.0, -90.0, 0.0], # West, East, South, North ... zoom=1, # less detailed zoom level - ... source=contextily.providers.Stamen.TerrainBackground, + ... source=contextily.providers.OpenTopoMap, ... lonlat=True, # bounding box coordinates are longitude/latitude ... ) >>> raster.sizes diff --git a/pygmt/src/tilemap.py b/pygmt/src/tilemap.py index b0fc0164076..2fd10efb923 100644 --- a/pygmt/src/tilemap.py +++ b/pygmt/src/tilemap.py @@ -74,8 +74,8 @@ def tilemap( :class:`xyzservices.TileProvider` object. See :doc:`Contextily providers ` for a list of tile providers [Default is - ``xyzservices.providers.Stamen.Terrain``, i.e. Stamen Terrain web - tiles]. + ``xyzservices.providers.OpenStreetMap.HOT``, i.e. OpenStreetMap + Humanitarian web tiles]. - A web tile provider in the form of a URL. The placeholders for the XYZ in the URL need to be {{x}}, {{y}}, {{z}}, respectively. E.g. ``https://{{s}}.tile.openstreetmap.org/{{z}}/{{x}}/{{y}}.png``. From 996f898a1316249dfa01a8979e7c02c588ed6413 Mon Sep 17 00:00:00 2001 From: Wei Ji <23487320+weiji14@users.noreply.github.com> Date: Thu, 5 Oct 2023 18:00:27 +1300 Subject: [PATCH 2/2] Use CartoDB Positron basemap for tilemap gallery example Switch from USGS Imagery Topo basemap to CartoDB Positron that is lighter in colour and suited for overlaying point data on top. --- examples/gallery/maps/tilemaps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/gallery/maps/tilemaps.py b/examples/gallery/maps/tilemaps.py index 2f052eca6de..1bd83069026 100644 --- a/examples/gallery/maps/tilemaps.py +++ b/examples/gallery/maps/tilemaps.py @@ -37,8 +37,8 @@ fig.tilemap( region=[-157.84, -157.8, 21.255, 21.285], projection="M12c", - # Use the U.S. Geological Survey Imagery Topo web tiles from contextily - source=contextily.providers.USGS.USImageryTopo, + # Use the CartoDB Positron option from contextily + source=contextily.providers.CartoDB.Positron, frame="afg", )