探索同一服务器上的图层
您可能在 WMS 数据库中找到一个自己喜欢的图层,并希望查找同一服务器上的其他图层。您可以使用功能文档来探索其他图层。
请指定美国宇航局 (NASA) SVS 图像服务器的 URL。使用 wmsinfo 函数将权限文档的内容作为 WMSCapabilities 对象返回。功能说明文档 是一种 XML 文档,其中包含描述服务器所提供地理内容的元数据。
serverURL = "http://svs.gsfc.nasa.gov/cgi-bin/wms?";
capabilities = wmsinfo(serverURL);将图层标题设置为一个变量。查看前三个标题。
layerTitles = {capabilities.Layer.LayerTitle}';
layerTitles(1:3)ans = 3×1 cell
{'African Fires During 2002 (1024x1024 Animation)' }
{'Background Image for African Fires During 2002 (WMS)' }
{'Aurora over the North Pole on April 17, 1999 (360x100 Animation)'}
阅读包含对流层臭氧影响的图层。显示地图。
layerTitle = "Tropospheric Ozone Impacts Global Climate Warming"; layer = refine(capabilities.Layer,layerTitle); [A,R] = wmsread(layer); figure worldmap(A,R) geoshow(A,R) title(layer.LayerTitle) plabel off mlabel off

该图层包含不同年份的数据。您可以通过访问 layer.Details.Dimension 结构来查看可用数据。
layer.Details.Dimension
ans = struct with fields:
Name: 'time'
Units: 'ISO8601'
UnitSymbol: ''
Default: '1994-'
MultipleValues: 0
NearestValue: 0
Current: 0
Extent: '1884-/1994-/P1Y'
显示 1884 年的地图,并将其与 1994 年的地图(即默认年份,之前已显示)进行比较。
year = "1884"; [A2,R] = wmsread(layer,Time=year); figure worldmap(A2,R) geoshow(A2,R) title(layer.LayerTitle,year) plabel off mlabel off
