问题描述
有什么方法可以将 USGS 网站上的图像导入 cartopy 吗?
https://services.nationalmap.gov/arcgis/rest/services/USGSNAIPImagery/ImageServer
通过窥探,我想
struct ld_sb
{
System.UIntPtr sb_sd;
byte Reserved1;
System.UIntPtr sb_naddr;
byte Reserved2;
}
public struct LDAP
{
ld_sb ld_sb;
string ld_host;
//...
}```
会抓取图像层。但我得到了以下异常。
ax.add_wms(
wms='https://services.nationalmap.gov/arcgis/services/USGSNAIPImagery/ImageServer/WMSServer?request=GetCapabilities&service=WMS',layers=[ '0' ],)
我认为服务器不能使用我使用的投影,但我使用的是 web 墨卡托投影,应该没有问题,我认为
/home/yosuke/miniconda3/envs/plotter/lib/python3.9/site-packages/cartopy/mpl/slippy_image_artist.py in draw(self,renderer,*args,**kwargs)
57 [x1,y1],[x2,y2] = ax.viewLim.get_points()
58 if not self.user_is_interacting:
---> 59 located_images = self.raster_source.fetch_raster(
60 ax.projection,extent=[x1,x2,y1,y2],61 target_resolution=(window_extent.width,window_extent.height))
/home/yosuke/miniconda3/envs/plotter/lib/python3.9/site-packages/cartopy/io/ogc_clients.py in fetch_raster(self,projection,extent,target_resolution)
307 located_images = []
308 for wms_extent in wms_extents:
--> 309 located_images.append(self._image_and_extent(wms_proj,wms_srs,310 wms_extent,311 projection,/home/yosuke/miniconda3/envs/plotter/lib/python3.9/site-packages/cartopy/io/ogc_clients.py in _image_and_extent(self,wms_proj,wms_extent,output_proj,output_extent,target_resolution)
278 output_extent,target_resolution):
279 min_x,max_x,min_y,max_y = wms_extent
--> 280 wms_image = self.service.getmap(layers=self.layers,281 srs=wms_srs,282 bBox=(min_x,max_y),/home/yosuke/miniconda3/envs/plotter/lib/python3.9/site-packages/owslib/map/wms111.py in getmap(self,layers,styles,srs,bBox,format,size,time,transparent,bgcolor,exceptions,method,timeout,**kwargs)
260 self.request = bind_url(base_url) + data
261
--> 262 u = openURL(base_url,data,timeout=timeout or self.timeout,auth=self.auth)
263
264 # check for service exceptions,and return
/home/yosuke/miniconda3/envs/plotter/lib/python3.9/site-packages/owslib/util.py in openURL(url_base,cookies,username,password,headers,verify,cert,auth)
233 if serviceException is not None:
234 # and we need to deal with some message nesting
--> 235 raise ServiceException('\n'.join([t.strip() for t in serviceException.itertext() if t.strip()]))
236
237 return ResponseWrapper(req)
ServiceException: Parameter 'srs' contains unacceptable value.
fig.add_subplot( *pos,projection=ccrs.Mercator.GOOGLE)
是否适合使用?或者我应该使用其他什么东西?
非常感谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)