Using WMS service layers

Web Mapping Service (WMS) services can be used in ArcMap (as well as in ArcScene and ArcGlobe) as map layers. Following are some common tasks for working with WMS service layers.

Table of contents

When added to ArcMap, the WMS service layer's entry in the table of contents is contracted to save space, but you can expand it and its groups to see the individual layers it contains.

A WMS service layer is made up of three entries that are arranged hierarchically in the table of contents. At the top is the name of WMS service, which holds all the WMS map layers. The next level is WMS group layers, whose only function is to organize WMS sublayers into related groups. There is at least one WMS group layer, but there can be any number of WMS group layers (and even nested groups within groups). WMS group layers do not hold any map layers—it is the third group, WMS sublayers, that actually contains the map layers.

Entries in the table of contents for a WMS service

Note the line connecting the sublayers together. This line prohibits you from inserting a layer within this service (group) layer or breaking apart the service layer into its constituent sublayers.

Some WMS services do not include legend information about the symbols used by the layers in the service. When legend information is not available, no symbology is shown for the layers in the table of contents. These layers will be listed in the table of contents without expansion controls next to them.

When a WMS service includes legend information, you can view the WMS sublayer's symbology in the table of contents by clicking the expansion control next to a sublayer. The legends for the layers in WMS services are all hidden by default, since accessing a legend for each layer in a WMS service requires sending a separate request to the server. For each additional layer, it is an additional request to the server.

The size of WMS legends can vary greatly. Sometimes the size of the legend specified by the server is too large to be displayed in the ArcMap table of contents. This usually happens when the legend for a layer contains multiple symbols, such as a transportation layer displaying symbology for the different types of roads. With WMS services, the legends for layers are transmitted over the Internet as one image containing all the symbols. Although ArcMap supports legend entries with multiple symbols in its table of contents, ArcMap expects these entries to contain multiple images, one image per symbol. ArcMap also places a limit on the size, height, and width (in pixels) of an image it will display in the table of contents. When the image received for a layer in a WMS service exceeds this limit, no legend is displayed for the layer. These layers are therefore listed in the table of contents without symbology and without expansion controls. When a WMS legend is available but does not display in the table of contents, you can view the legend on the Styles tab of the WMS sublayer's Layer Properties dialog box.

Getting information about the WMS service layer

The service layer properties Source tab displays information such as the map extent, data (service) type, the URL, service name, and the default coordinate system of the service.

WMS service Data source

You can get information about each WMS sublayer from the service sublayer properties Source tab. This includes the capabilities of the sublayer (whether or not the layer supports Identify), whether a legend is available for the sublayer, the default coordinate system, and a list of server-supported coordinate systems for this particular sublayer.

WMS service sublayer Data source
NoteNote:

The layer name shown may not be the same as what is in the table of contents and on the General tab. This is because the text used for the layer name on the Source tab is taken from the <Name> tag in the WMS service capabilities file, which is the file used to describe the service. However, ArcMap uses the more descriptive <Title> tag from the capabilities file to populate the layer name for the table of contents and the General tab.

The Layers tab displays all the members of the WMS service. Information provided by the WMS server for each WMS layer is displayed in a box on the lower left of the dialog box.

WMS service Layers tab

Changing the display of the WMS service layer

There are a number of things you can do to affect the display of a Web map layer. These include changing the feature symbology, toggling layer or label visibility, changing the drawing order of service sublayers, setting a background for the service, applying transparency, and (if supported by the server) visualizing the service based on a time parameter.

Depending on how the WMS service is authored, you may be able to change the rendering of a WMS layer. WMS layer rendering is determined by a style. The style consists of the symbols and colors used to represent features in a WMS service. The WMS specification allows a WMS layer to contain any number of styles. You can choose from the available styles using the Styles tab of the WMS service sublayer's Layer Properties dialog box.

WMS Layer Properties dialog box Styles tab

If the WMS service does not support styles, you will see Legend not available in the preview window. As you choose different styles from the drop-down menu, the information in the text box and the image in the preview window changes accordingly. You can preview as many of the listed styles as you want. The style is not applied to the layer until you click OK or Apply. Once you do this, ArcMap sends a new GetMap request to the WMS server using the new style.

This tab also includes information describing the given style, the height and width of the legend image in pixels, the URL for the legend image, and the image format.

NoteNote:

Changing the rendering of a WMS layer in ArcMap is restricted to the preset styles documented in the service's capabilities file.

For more information regarding OGC WMS specifications, see the OGC Web site at www.opengeospatial.org/standards.

You can turn the visibility of service and service sublayers on and off using the check boxes in the table of contents. You cannot toggle the visibility of WMS sublayer labels.

When you add a WMS service into ArcMap, all the layers in that service are available for display in the map, even if you only add a single WMS sublayer or a single WMS group layer. Even though the table of contents entry for the service layer only lists the added sublayer, you still have access to the entire list of sublayers through the Layer Properties dialog box of the service layer. In cases where you add an entire WMS service, the table of contents entry for the service layer will include all the layers and groups, using the drawing order defined by the author of the service. Some WMS services contain a large number of layers and are more like data collections than individual maps.

The Layers tab allows you to choose which WMS service sublayers to display in your map. If you want to remove some of the sublayers from the map and the table of contents, simply use the Just the layers listed below option and don't include them in that list. You can also control layer visibility and drawing order.

WMS service Layers

On the left side of this dialog box, you will see all the WMS group layers and WMS sublayers for the service listed. Those items can only be changed by the author of the service. However, clicking Just the layers listed below on the right side of the tab allows you to configure which layers in the WMS service will be included in its table of contents entry, add and remove specific WMS layers from your map, and control layer visibility and drawing order.

To change the drawing order, click the Just the layers listed below option and move the WMS sublayers you want in your map to the right side of the dialog box. Now, you can select the WMS sublayers and use the arrow buttons to move them up or down the hierarchy to change the drawing order. When you use the Just the layers listed below option, any groups into which the layers have been organized by the publisher of the service will not be reflected in the table of contents. The layers you choose will appear in a flat, ungrouped list in the table of contents, the same as they appear on the right side of the dialog box.

Steps:

  1. Right-click the WMS service layer in the table of contents and click Properties.
  2. Click the Layers tab.
  3. Click Just the layers listed below.
  4. Click the layer or layers that you want to list in the table of contents. You can hold down CTRL or SHIFT to choose multiple WMS sublayers.
  5. Click the single arrow Add selected layers to add selected layers or the double arrow Add all layers to add all WMS sublayers. You can also click the arrow with a check mark Add visible layers to add only the visible layers.
  6. Use the remove single arrow Remove selected layers to remove the selected layers or the remove all double arrow Remove all layers to remove all WMS sublayers.
  7. Click OK.

When you apply these changes, you will see the updates in the table of contents, and the new drawing order will be reflected in your map. ArcMap sends a new request to the WMS server to account for the new drawing order.

TipTip:
You can use the Layers tab to add or remove specific WMS sublayers from the table of contents. If you use the All layers option to add all the WMS group and WMS sublayers back to the table of contents, visibility for all the layers will be off.

You can change the background color of the service layer, set a specific color as transparent, apply a level of transparency to the service layer, or change the image type received from the server using the options available on the Advanced tab.

The Advanced tab on the Properties dialog box for ArcGIS map service layers

Many Web map services support multiple image formats. If the WMS server supports PNG format ArcMap will, by default, request images in PNG. PNG is a general purpose format that will not reduce image quality. That is why it is the default. PNG returns a high-quality image that supports transparency. However, the file size can be much larger than other formats and be slower to download from the server. JPEG can be much faster since its size can be much smaller than a PNG. However, JPEG does not support transparency. JPEG is really only appropriate for imagery data. JPEG should really only ever be used for imagery. JPEG would be a good option if you using WMS layer based on imagery as a basemap. Also, choosing JPEG from the Layer Image Format drop-down list could improve performance. Or course the WMS server must support JPEG for it to be available. If you are overlaying the WMS service on top of other layer, or want the best highest quality image available, you should use PNG (provided the WMS server supports this format).

To choose an available image format, go to the Advanced tab on the Layer Properties dialog box and choose the format from the Layer Image Format drop-down list. This drop-down list will only display formats supported by the service. You cannot choose a format not supported by the service.

CautionCaution:

When using a format that does not support transparency, such as JPEG, functionality dependent on transparency is disabled for this layer.

Visualizing temporal data can help you step through your data and see the patterns or trends that emerge over time. In ArcMap, ArcGlobe, or ArcScene, you can enable your temporal data to participate in time and visualize it using a simple time slider that changes the data in the display or in a graph through time. If the service supports time, you will see the Time tab of the Layer Properties dialog box. For more information on visualizing time, see using the time slider.

Changing WMS service layer properties

There are a couple of properties you can change for a service layer, such as changing the name of the service layer, changing the description, and setting visibility scale ranges or the image format returned by the server.

You can change the name the service layer either by clicking the service layer in the table of contents and typing a new name or by opening the General tab of the Layer Properties dialog box and entering a new name there. The Description text box is initially populated with an abstract, when one is provided by the service. You can change the description for WMS service layers, but the Description text box for group and WMS sublayers within the WMS service are read-only.

You can set visible scale ranges on the service layer where all the sublayers contained within it only draw when the map is within specified scale range. By setting a scale range on a service layer, you can avoid sending image requests to the server at map scales that are inappropriate for the layer's data. You set scale ranges on the General tab on the Layer Properties dialog box. Scale ranges can only be set at the service level for map services. You cannot set them for service sublayers.

Here are some things to keep in mind when interacting with WMS sublayers at various map scales:

Learn more about displaying layers at certain scales

Displaying the WMS service layer in different coordinate systems

When using WMS services, you may want to keep to server-supported coordinate systems for best results. WMS servers may only support a limited set of coordinate systems, depending on how the service has been configured by its author. In addition, each WMS sublayer within the WMS service can potentially support a different set of coordinate systems. Like with other layers, if a WMS service layer is the first layer added to a new, empty data frame, the data frame will take on the WMS service's default coordinate system.

If the data frame is in a coordinate system that is not supported by the WMS server, ArcMap gets an image from the server in a supported coordinate system—in most cases, this will be in GCS 1984—and projects this image internally so it will display in your map. In other words, ArcMap will project this image on the fly. Depending on the coordinate system being used by the data frame, there may be some level of distortion in the display of the WMS layer—most noticeably if the layer has text. The benefit of using only coordinate systems supported by the WMS server is that the image returned by the WMS server is not postprocessed to fit into an unsupported coordinate system.

For more information, see How to choose a coordinate system supported by a WMS server.

Querying features from the WMS service layer

Identifying features is the only querying task you can perform on WMS layers, although the format of information you receive can vary depending on the server. ArcMap displays what is returned by the server inside an Internet Explorer control embedded in the Identify window. The result of an Identify query may be provided as field/value pairs, HTML, or images.

By the OGC WMS specification, WMS services are not required to support <GetFeatureInfo>, which is the request ArcMap sends to the server when you query features of a WMS service. If the service supports identifying, like the one in the graphic below, you will see its sublayers listed in the Identify window. If you don't see them listed, you won't be able to identify features from that WMS service.

WMS service layer that supports identifying, since the sublayers are listed in the Identify from: list

Because there is no concept of a primary display field for a feature identified in a WMS service layer, the node in the Identify tree representing the features in a WMS service layer is always referred to as WMS Feature(s).

When you identify a feature from a WMS service layer, you should either use the <Visible Layers> option, which will identify features in any of the visible layers in the WMS service layer, or choose the particular layer you are interested in identifying. This is because the default option, <Top-most layer>, may not work as you expect. When you use this option and click the map, Identify will only work on features from the topmost layer in the WMS service's drawing hierarchy. If there are no features present in the layer at that location, this option does not automatically identify features from layers lower in the drawing hierarchy as it does with other layer types, such as those referencing shapefiles or geodatabase feature classes. Instead, you'll receive null results. This is a limitation of WMS servers.

In addition, Identify tolerance levels are determined by the WMS server, not ArcMap. When Identifying WMS point features, you may have to repeat your clicks until you get close enough to the feature to register a positive result.

Printing and exporting a map containing a service layer

You can print and export maps containing service layers. However, you need to be aware of limitations that are inherent with working with image-based services. For more information, see Printing and exporting maps containing service layers.

How WMS server errors are handled

You may sometimes get an error message from particular WMS services when you add them into a map. As with any live Web mapping service based on images, when ArcMap attempts to draw a WMS service in a map, it sends a request for an image to the WMS server providing that service. If the server returns an error instead of an image, ArcMap will display that error message. These error messages, which appear each time you redraw the map, reflect problems with the WMS service and normally can't be remedied in ArcMap. ArcMap displays these messages to warn you that something about the WMS service is not working as ArcMap expects and also to provide a basic diagnostic capability. However, because these errors can vary widely between different WMS servers, it is difficult for ArcMap to tell you the exact problem. As a result, the error messages are fairly generic, and what the problem is may not be obvious. For example, the error may be caused by a particular layer belonging to the WMS service or to a particular combination of layers.

If you get an error message, you can stop it from appearing again by simply unchecking the WMS service in the table of contents or removing it from your map. Sometimes, you may be able to tell which layer in the WMS service is causing the problem. In that case, try turning off that particular layer in the table of contents to prevent the error message from appearing.

Note that if you get an error message from a WMS service, it doesn't necessarily mean that you won't be able to draw this service in your map at all. For example, some WMS services may return the error "Bounding box has an invalid area" when you try to draw them at a very small scale, but the service will draw, and the error message won't appear when you zoom in to larger scales. In this situation, you should specify a scale range for the WMS service layer using the General tab of its Layer Properties dialog box so the layer is not drawn at very small scales. This will prevent the error messages from appearing when the layer can't be drawn.

Related Topics


5/2/2011