使用Cartopy加快高分辨率海岸线绘图的速度

问题描述 投票:0回答:1

我想加快这段代码的执行速度:

import cartopy.crs as ccrs
from cartopy.feature import NaturalEarthFeature
import matplotlib.pyplot as plt

# the extent in the original code is calculated on the fly
extent = [0, 50, 20, 60]

plt.figure("Test Map")
ax = plt.subplot(111, projection=ccrs.PlateCarree())
ax.set_extent(extent, crs=ccrs.PlateCarree())

ax.add_feature(NaturalEarthFeature('physical', 'ocean', '50m'))

plt.show()

该代码当前需要几秒钟来可视化结果图。当我在结果图中平移时,可以看到cartopy实际上已经绘制了所有多边形!cartopy有剪切功能吗?

performance clipping cartopy
1个回答
0
投票

简短的答案是,不,CartoPy没有任何内置的剪切操作。但是,CartoPy使用的Shapely确实可以。

© www.soinside.com 2019 - 2024. All rights reserved.