I have been struggling with generating a shaded relief to underlay my cartopy maps. This srtm_shading example is very slow for downloading data from new areas. Is there any way to use a shaded relief image instead?
This image tiling seems promising, but I couldn't figure out how to get just shaded relief in grayscale rather than terrain.
I found an ESRI shaded relief tiler and implemented a class that called to the tiler. I have submitted a pull request, but in the meantime:
from cartopy.io.img_tiles import GoogleTiles
class ShadedReliefESRI(GoogleTiles):
# shaded relief
def _image_url(self, tile):
x, y, z = tile
url = ('https://server.arcgisonline.com/ArcGIS/rest/services/' \
'World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}.jpg').format(
z=z, y=y, x=x)
return url
As an example:
import matplotlib.pyplot as plt
ax = plt.axes(projection=ShadedReliefESRI().crs)
ax.set_extent([-22, -15, 63, 65])
ax.add_image(ShadedReliefESRI(), 8)
Just be sure that you comply with ESRI use guidelines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With