This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

getMap

Get raster map from server

Syntax

A = getMap(server,mapRequestURL)

Description

example

A = getMap(server,mapRequestURL) dynamically renders and retrieves a color or grayscale, geographically referenced, raster map from the Web map services server, server, and stores it in A. Parameters in the URL, mapRequestURL, define the map. The getMap function also updates the RequestURL property of the server with mapRequestURL.

Examples

collapse all

Retrieve a map of the Blue Marble global mosaic layer from the NASA Earth Observations WMS server.

neowms = wmsfind('neowms', 'SearchField', 'serverurl');
layer = refine(neowms, 'bluemarbleng', 'MatchType', 'exact');

server = WebMapServer(layer.ServerURL);
mapRequest = WMSMapRequest(layer, server);
A = getMap(server, mapRequest.RequestURL);
R = mapRequest.RasterReference;

Display the map.

figure
worldmap world
geoshow(A, R)
setm(gca,'MLabelParallel',-90,'MLabelLocation',90)
title(layer.LayerTitle)

Input Arguments

collapse all

Web map server, specified as a WebMapServer object.

URL, specified as a character vector. Parameters in the URL define the map.

Output Arguments

collapse all

Rendered map, returned as a color or grayscale image.

Tips

getMap accesses the Internet to retrieve the map. Periodically, the WMS server is unavailable. Retrieving the map can take several minutes.

Introduced before R2006a