2016-05-24 18 views
2

我一直在努力生成一個陰影的救濟底層我的cartopy地圖。這個srtm_shading example從新區域下載數據非常緩慢。有什麼方法可以使用陰影浮雕圖像嗎?Cartopy shaded relief

這個image tiling看起來很有前途,但我無法弄清楚如何在灰度而不是地形上得到陰影的浮雕。

回答

3

我發現了一個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