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
Database.
Mapping 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 phrase
'etopo1 hillshade'
.
elevationLayer = wmsfind('etopo1 hillshade');
Refine your
search. In this example, the wmsfind
function
returns only one layer. As a result, you do not need to refine your
search.
Update your
layer. Contact the web server identified in the database search
to get the most up-to-date information. The wmsupdate
function accomplishes two tasks:
Updates your WMSLayer
object to include the
most recent data
Fills in its Details
,
CoordRefSysCodes
, and
Abstract
fields
elevationLayer = wmsupdate(elevationLayer);
Modify your WMS
request. Create map axes with geographic limits appropriate for
Europe. Then, get the map axes map structure (mstruct
),
which contains the settings for all the current map axes properties. You can
use this mstruct
to modify your WMS request. For example,
you can set geographic limits, image dimensions, background color, and other
properties of the map.
figure
worldmap europe
mstruct = gcm;
Retrieve your
map. Read the layer using the wmsread
function. Set the longitude and latitude limit parameters to the current map
axes limits.
[elevationImage,R] = wmsread(elevationLayer,'Latlim', ... mstruct.maplatlimit,'Lonlim',mstruct.maplonlimit);
The wmsread
function returns a map called
elevationImage
and a raster reference object
R
, which ties the map to a specific location on
Earth.
Display the map on the map axes and add a title.
geoshow(elevationImage,R) title({'Europe','Elevation'})