Basic Workflow for Creating WMS Maps

Workflow Summary

  1. Search the WMS Database for layers and servers that are of interest to you.

  2. Refine your search to include only servers or layers with specified field values.

  3. Update your layer to synchronize your selected layer with the server.

  4. Modify your WMS request to set properties like geographic limits, image dimensions, or background color of the map.

  5. Retrieve your map as a raster image from the server.

  6. Display the map.

Create a Map of Elevation in Europe

Follow the example to learn the basic steps in creating a WMS map.

  1. 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');
    
  2. Refine your search. In this example, the wmsfind function returns only one layer. As a result, you do not need to refine your search.

  3. 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);
  4. 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;
  5. 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.

  6. Display the map on the map axes and add a title.

    geoshow(elevationImage,R)
    title({'Europe','Elevation'})

See Also

| |

Related Topics