python - Cartopy 阴影浮雕

标签 python matplotlib gis cartopy

我一直在努力生成一个阴影浮雕来衬托我的 cartopy map 。这srtm_shading example从新区域下载数据非常慢。有什么方法可以改用阴影浮雕图像吗?

image tiling看起来很有希望,但我无法弄清楚如何在灰度而不是地形中获得阴影浮雕。

最佳答案

我找到了一个 ESRI 阴影浮雕拼贴器并实现了一个调用拼贴器的类。我已提交拉 request ,但与此同时:

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

举个例子:

import matplotlib.pyplot as plt
ax = plt.axes(projection=ShadedReliefESRI().crs)
ax.set_extent([-22, -15, 63, 65])
ax.add_image(ShadedReliefESRI(), 8)

shaded relief

请确保您遵守 ESRI use guidelines .

关于python - Cartopy 阴影浮雕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37423997/

相关文章:

python - 将 svg 文件导入 matplotlib 图

python - Matplotlib 具有相同类变量的多个动画

postgresql - 类型 "geometry"不存在

memory-management - 创建大型列表、字典或数组时出现内存错误

Python 和 UIO 设备 : Why does mmap. read() 工作而 os.read() 失败?

python - PyInstaller 无法在 Linux 中构建 'Firebase Firestore python file'

python - 具有不同标记和颜色的 matplotlib 散点图

c# - Windows 应用商店应用程序的免费映射组件?

python - 删除 Python 中连续部分重复的元素

python - tqdm progressbar 和 zip 内置不能一起工作