Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

WebMapServer

Web map server

Description

A WebMapServer object represents a Web Map Service (WMS) and acts as a proxy to a WMS server.

The WebMapServer object resides physically on the client side. The object can access the capabilities document on the WMS server and perform requests to obtain maps. It supports multiple WMS versions and negotiates with the server automatically to use the highest known version that the server can support.

Creation

server = WebMapServer(serverURL)

Description

example

server = WebMapServer(serverURL) creates a WebMapServer object, setting the ServerURL property.

Properties

expand all

Number of milliseconds before a server times out, specified as a nonnegative integer. When Timeout has a value of 0, the WebMapServer object ignores the timeout mechanism.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Flag enabling cache, specified as a logical scalar. When EnableCache is True, the WebMapServer object caches the WMSCapabilites object, which is returned when you use the getCapabilities method. The cache expires if the AccessDate property of the cached WMSCapabilities object is not the current day.

Data Types: logical

URL of the server, specified as a character vector. The URL must include the protocol 'http://' or 'https://'. The URL can contain additional WMS keywords.

Data Types: char

URL of the last request to the server, specified as a character vector. RequestURL specifies a request for either the XML capabilities document or a map. You can insert the requested URL into a browser.

Data Types: char

Object Functions

getCapabilities Get capabilities document from server
getMapGet raster map from server
updateLayersUpdate layer properties

Examples

expand all

Construct a WebMapServer object that communicates with one of the Environmental Research Division's Data Access Program (ERDDAP) WMS servers hosted by NOAA and obtains its capabilities document. Search for a server that provides daily, global sea surface temperature (sst) data produced by the Jet Propulsion Laboratory's Regional Ocean Modeling System (JPL ROMS) group.

layers = wmsfind('coastwatch*jpl*sst','SearchField','serverurl');
serverURL = layers(1).ServerURL;
server = WebMapServer(serverURL);
capabilities = getCapabilities(server);
layers = capabilities.Layer;

Obtain data from the server. Show the boundaries of the nations and the global SST data.

nations = refine(layers,'nations');
nations = nations(1);
sst = refine(layers,'sst');
sst = sst(1);
layer = [sst nations];
request = WMSMapRequest(layer,server);
A = getMap(server,request.RequestURL);
R = request.RasterReference;

Display data from the server.

figure
worldmap(A,R)
geoshow(A,R)
title({sst.LayerTitle,sst.Details.Dimension.Default})

See Also

Functions

Using Objects

Introduced before R2006a

Was this topic helpful?