Search the WMS Database for layers and servers that are of interest to you.
Refine your search to include only servers or layers with specified field values.
Update your layer to synchronize your selected layer with the server.
Modify your WMS request to set properties like geographic limits, image dimensions, or background color of the map.
Retrieve your map as a raster image from the server.
Display the map.
Follow the example to learn the basic steps in creating a WMS map.
Search the WMS
Toolbox™ software simplifies the process of WMS map creation by using a
stored database of WMS servers. You can search the database for layers and
servers that are of interest to you. WMS servers store map data in units
called layers. For this example, search for layers that contain the word
elevation = wmsfind('elevation');
wmsfind returns an array of hundreds of
search. Refine your search to include only layers that contain
the exact name,
'Foundation.GTOPO30' in the
LayerName field. (GTOPO30 is a digital elevation
model developed by the United States Geological Survey (USGS).) Then, refine
the results of this search further by searching the
serverurl field for
gtopolayer = refine(elevation,'Foundation.GTOPO30', ... 'SearchField','layername'); gtopolayer = refine(gtopolayer,'nfis.org', ... 'SearchField','serverurl');
layer. Contact the web server identified in the database search
to get the most up-to-date information. The
function accomplishes two tasks:
WMSLayer object to include the
most recent data
Fills in its
Setup a map axes with geographic limits appropriate for Europe.
figure worldmap europe;
Modify your WMS
request. Retrieve the map axes map structure
mstruct), which contains the settings for all the
current map axes properties. You can use this struct to modify your WMS
request. For example, you can set geographic limits, image dimensions,
background color, and other properties of the map. In this simple example,
define the color you want to use a the map background color. Choose red,
green, and blue levels to define an ocean color.
mstruct = gcm; oceanColor = [0 170 255];
map. Use the
gtopolayer as input for
wmsread longitude and latitude limit parameters
to the current map axes limits and set the
BackgroundColor parameter to
[elevationImage, R] = wmsread(gtopolayer,'Latlim', ... mstruct.maplatlimit,'Lonlim',mstruct.maplonlimit, ... 'BackgroundColor',oceanColor);
wmsread function returns a map called
elevationImage and a raster reference object
R, which ties the map to a specific location on