Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch away from Stamen basemaps #2717

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
weiji14 committed Oct 4, 2023
commit 99a20a08e8d33a40682e30526ef1091af3511d9f
4 changes: 2 additions & 2 deletions examples/gallery/maps/tilemaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Member Author

@weiji14 weiji14 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The USImageryTopo map looks like this:

image

Alternatively, I was also thinking that the CartoDB basemaps could be a good option (that is also global in coverage). E.g. CartoDB Positron which has a lighter colour and might be better to overlay other data on top:

cartodb_positron

Any preference, or other options to consider?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also thinking that the CartoDB basemaps could be a good option (that is also global in coverage). E.g. CartoDB Positron which has a lighter colour and might be better to overlay other data on top:

Sounds good to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, switched to CartoDB Positron in 996f898.

frame="afg",
)

Expand Down
6 changes: 3 additions & 3 deletions pygmt/datasets/tile_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <contextily:providers_deepdive>` 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``.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def tilemap(
:class:`xyzservices.TileProvider` object. See
:doc:`Contextily providers <contextily:providers_deepdive>` 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``.
Expand Down
Loading