One of the challenges of working with WMS is that sometimes you can have trouble connecting to a server.
A server may issue a time-out error such as:
Connection timed out: connect
Read timed out
Workaround: Try setting the
to a larger value. The time-out setting defaults to 60 seconds. (The
wmsupdate all have
The NASA Jet Propulsion Laboratory (JPL) server may issue the following error message:
This server no longer provides full WMS services!
The DataFed server,
cascades layers from the JPL server and may issue the following error
Error in Execution. Cannot fetch url.
Workaround: Use a
or find a different server.
The JPL Global Imagery Service server,
is no longer providing full WMS services for any of the datasets.
Any server (for example,
that cascades data from this server is also affected by the change.
A small subset of the data can be accessed using a non-standard
The available tiled patterns can be found at:
The WMS parameters must be in the exact order. If you wish to
obtain a tile, you can prepend the prefix,
front of the request found in the
url = ['http://onearth.jpl.nasa.gov/wms.cgi?/SERVICE=WMS&Version=1.1.1&' ... 'request=GetMap&layers=global_mosaic&srs=EPSG:4326&' ... 'format=image/jpeg&styles=visual&width=512&height=512&' ... 'bbox=-180,58,-148,90']; [A, R] = wmsread(url);
Elevation layers from
be replaced with layers from the NASA WorldWind server (
The Blue Marble layer can be replaced with a Blue Marble layer from
the NASA Goddard Space Flight Center WMS SVS Image Server (
or the Blue Marble: Next Generation layer from the NASA Earth Observations
(NEO) WMS Server (
The Daily Planet layer can be replaced with the
Color (1 day - Terra/MODIS Rapid Response)' layer from the
NASA Earth Observations (NEO) WMS server.
In some cases, the server becomes temporarily unavailable or the WMS server application experiences some type of issue. The server issues an HTTP response code of 500, such as:
Server returned HTTP response code: 500 for URL: http://xyz.com ...
Workaround: Try again later.
Also try setting a different
columbo.nrlssc.navy.mil server issues
an error such as:
WebMapServer cannot communicate to the host columbo.nrlssc.navy.mil. The host is unknown.
This message indicates that the server it is trying to access is no longer available.
Workaround: Choose a different layer.
columbo.nrlssc.navy.mil server often
throws this error message:
This layer is not visible for this scale. The maximum valid scale is approximately X. Zoom in and try again if desired. The scale of the image requested is Y.
Y represent specific
values that vary from layer to layer.
Workaround: Some of the WMS sources this server accesses have map layers sensitive to the requested scale. Zoom in (choose a smaller region of interest), or zoom out (choose a larger region of interest). Alternatively, you can select a larger output image size to view the layer at the appropriate scale.
Some servers do not follow the guidelines of the OGC® specification regarding latitude and longitude limits.
The OGC specification requires, and the WMS functions expect, that the limits are ascending. Some sites, however, have descending limits. As a result, you may get this error message:
"??? Error using ==> WMSMapRequest>validateLimit at 1313 Expected the elements of 'Latlim' to be in ascending order."
Workaround: To address this
problem, set the
layer = wmsfind('SampleServer.com', 'SearchField', 'serverurl'); layer = wmsupdate(layer); latlim = [min(layer.Latlim), max(layer.Latlim)]; lonlim = [min(layer.Lonlim), max(layer.Lonlim)]; layer.Latlim = [max([ -90, latlim(1)]), min([ 90, latlim(2)])]; layer.Lonlim = [max([-180, lonlim(1)]), min([180, lonlim(2)])]; [A,R] = wmsread(layer);
Update your layer before setting the limits. Otherwise,
the limits from the server, and you once again have descending limits.
Some servers have limits that exceed the bounds of [-180 180] for longitude and [-90 90] for latitude.
Workaround: To address this problem, follow the same procedure outlined in Latlim and Lonlim in Descending Order.
In most cases, the updated layer returned by
that match those of the layer you enter as input. In some cases when
the layer is updated from the
the server returns a layer with a different
the same. The layers from the
have names such as
ASCII numbers. Since the time of your last update, a layer has been
added to or removed from the server causing a shift in the sequence
of layers. Since the
LayerName property is constructed
with ASCII numbers based on the layer's position in this sequence,
LayerName property has changed. For layers
LayerTitle property rather than the
Some layers are not defined in the EPSG:4326 or CRS:84 coordinate
reference system. You cannot read these layers with the
Workaround: Use the
to construct a request URL and the
to read the layer. See Understanding
Coordinate Reference System Codes and Retrieving Your
WebMapServer.getMap for more information.
Sometimes you can connect to the WMS server, but you do not receive the map you are expecting.
A server may return a blank map.
Workaround: You can change
the scale of your map; either increase the image height and width
or change the geographic bounds. Another possibility is that your
requested geographic extent lies outside the extent of the layer,
in which case you should change the extent of your request. A third
possibility is that you have the wrong image format selected; in this
case, change the
You may receive this error message:
The server returned an HTML file instead of an image file.
Workaround: Follow the directions in the error message. The following example, which uses a sample URL, illustrates the type of error message you receive.
% Example command. [A,R] = wmsread(['https://www.mathworks.com?',... '&BBOX=-180,-90,180,90&CRS=EPSG:4326&VERSION=1.1.1']);
Sample error message:
Error using WebMapServer>issueReadGetMapError (line 974) The server returned an HTML file instead of an image file. You may view the complete error message by issuing the command, web('https://www.mathworks.com?&BBOX=-180,-90,180,90&CRS=EPSG:4326&VERSION=1.1.1') or urlread('https://www.mathworks.com?&BBOX=-180,-90,180,90&CRS=EPSG:4326&VERSION=1.1.1'). Error in WebMapServer>readImageFormat (line 874) issueReadGetMapError(filename, requestURL); Error in WebMapServer>readGetMapFile (line 852) A = readImageFormat(filename, requestURL); Error in WebMapServer/getMap (line 299) A = readGetMapFile(filename, h.RequestURL); Error in wmsread (line 376) A = server.getMap(mapRequestURL);
The server issues a very long error message, beginning with the following phrase:
An error occurred while attempting to get the map from the server. The error returned is <?xml version="1.0" encoding="utf-8"?> ...
Workaround: This problem occurs because the server breaks with the requirements of the OGC standard and returns the XML capabilities document rather than the requested map. Choose a different layer or server.
In rare cases, the server uses a different and unsupported WMS version. In this case, you receive an error message such as:
The WMS version, '1.2.0', listed in layer.Details.Version is not supported by the server. The supported versions are: '1.0.0' '1.1.0' '1.1.1' '1.3.0' .
Workaround: Choose a different server.
The server issues an error indicating that no correction or workaround exists. These cases result in the following types of error messages:
Server redirected too many times (20) An error occurred while attempting to parse the XML capabilities document from the server. Unexpected end of file from server An error occurred while attempting to get the map from the server. The server returned a map containing no data.