如何从通过cartopy的feature
界面导入的数据中提取轮廓线?如果解决方案涉及geoviews.feature
或其他包装器,那当然可以。
例如,我将如何提取cfeature.COASTLINE
以下示例中绘制的数据?
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
ax = plt.axes(projection=ccrs.PlateCarree())
ax.add_feature(cfeature.COASTLINE)
plt.show()
我很感激你可能有任何提示!
FWIW,在basemap
,我会这样做:
import mpl_toolkits.basemap as bm
import matplotlib.pyplot as plt
m = bm.Basemap(width=2000e3,height=2000e3,
resolution='l',projection='stere',
lat_ts=70,lat_0=70,lon_0=-60.)
fig,ax=plt.subplots()
coastlines = m.drawcoastlines().get_segments()