wmsread
Retrieve WMS map from server
Syntax
Description
[ accesses the Internet
to render and retrieve a raster map from a Web Map Service (WMS) server.
The A,R] =
wmsread(layer)ServerURL property of the WMSLayer object, layer,
specifies the server. If layer has more than one
element, then the server overlays each subsequent layer on top of
the base (first) layer, forming a single image. The server renders
multiple layers only if all layers share the same ServerURL value.
The WMS server returns a raster map, either a color or grayscale
image, in the output A. The second output, R,
is a raster reference object that ties A to the EPSG:4326
geographic coordinate system. The rows of A are
aligned with parallels, with even sampling in longitude. Likewise,
the columns of A are aligned with meridians, with
even sampling in latitude.
The geographic limits of A span the full
latitude and longitude extent of layer. The wmsread function
chooses the larger spatial size of A to match its
larger geographic dimension. The larger spatial size is fixed at the
value 512. In other words, assuming RGB output, A is 512-by-N-by-3 if
the latitude extent exceeds longitude extent and N-by-512-by-3 otherwise.
In both cases N <= 512. The wmsread function
sets N to the integer value that provides the closest
possible approximation to equal cell sizes in latitude and longitude.
The map spans the full extent supported for the layer.
[ specifies
parameter-value pairs that modify the request to the server. You can
abbreviate parameter names, which are case-insensitive.A,R] =
wmsread(layer,Name,Value,...)
[ uses the input
argument A,R] =
wmsread(mapRequestURL)mapRequestURL to define the request to
the server. The mapRequestURL contains a WMS serverURL with
additional WMS parameters. These WMS parameters include BBOX, GetMap and
the EPSG:4326 or CRS:84 keyword.
Obtain a mapRequestURL from the output of wmsread,
the RequestURL property of a WMSMapRequest object,
or an Internet search.
[ returns a WMS A,R,mapRequestURL]
= wmsread(...)GetMap request
URL in the character vector mapRequestURL. You
can insert the mapRequestURL into a browser to
make a request to a server, which then returns the raster map. The
browser opens the returned map if its mime type is understood, or
saves the raster map to disk.
Examples
Input Arguments
Name-Value Arguments
Output Arguments
More About
Tips
Establish an Internet connection to use
wmsread. Periodically, the WMS server is unavailable. Retrieving the map can take several minutes.wmsreadcommunicates with the server using aWebMapServerobject representing a WMS server. The object acts as a proxy to a WMS server and resides physically on the client side. The object retrieves the map from the server. The object automatically times-out after 60 seconds if a connection is not made to the server.To specify a proxy server to connect to the Internet, select File > Preferences > Web and enter your proxy information. Use this feature if you have a firewall.
wmsreadsupports reading data in WMS versions 1.0.0, 1.1.1, and 1.3.0. For version 1.3.0 only, the WMS specification states, "EPSG:4326 refers to WGS 84 geographic latitude, then longitude. That is, in this CRS the x-axis corresponds to latitude, and the y-axis to longitude." Most servers provide data in this manner; however, some servers conform to version 1.1.1, where the x-axis corresponds to longitude and the y-axis to latitude.wmsreadattempts to validate whether a server is confirming to the specification. It checks the EPSG:4326 bounding box, and if theXLimvalues exceeds the range of latitude, then the axes are swapped to conform to version 1.1.1 rather than 1.3.0. Ifwmsreaddoes not detect that theXLimvalues exceed the range of latitude and you notice that the latitude and longitude limits are reversed, then you need to swap them. You can either modify thebboxparameters in themapRequestURLor modify theLatlimandLonlimparameter values, if permissible.
Version History
Introduced before R2006a
See Also
wmsfind | wmsinfo | wmsupdate | WebMapServer | WMSLayer



