You have two options for visualizing Web Map Service (WMS) data in LuciadRIA: you can either visualize it as tiled data or as images. This article discusses the differences between the two options, and recommends the best approach for your WMS visualization needs.

WMS is a web service that can generate an image from a part of a map. It allows you to configure:

  • The resolution of the image in number of pixels

  • A bounding box that defines the part of the world you want to show

  • The WMS layers that contain the data you want to visualize alongside a number of other parameters.

For more information about visualizing WMS data, see the OGC WMS documentation.

What does LuciadRIA offer for WMS visualization?

LuciadRIA offers a number of API components for tuning the visualization to your needs. To choose the most suitable components, you typically need to make a trade-off between:

  • Performance: WMS is very flexible by nature, but not necessarily very fast. LuciadRIA allows you to visualize WMS data very quickly, but visualization quality will be reduced as a consequence.

  • Quality: if visualization quality is crucial for your application, you can choose to visualize WMS data with a higher visual fidelity, but with certain performance drawbacks.

This article provides you with the technical background necessary to make an informed decision.

Which WMS visualization option do I choose?

Table 1. Overview of WMS model pros and cons
Options What does it do? Pros ✔ Cons ⛔ Recommended for

WMSTileSetModel

The WMSTileSetModel defines a multi-leveled tile structure on top of the WMS.

When it visualizes the WMSTileSetModel in a RasterTileSetLayer, LuciadRIA defines a tile structure on your WMS data, and calculate what tiles are in the view. Next, it loads images from the WMS server that correspond with the size (in pixels) and bounds of the tiles.

Fast

LuciadRIA caches the WMS images, and re-uses the tiles available in the cache.

Supported on WebGL maps

Lower quality

  • Only defined tile levels will be shown. If you navigate the map to a scale level in between two tile levels, LuciadRIA renders the tile level closest to that scale level, possibly with unexpected results.

  • WMS is not aware of the tiling structure imposed by LuciadRIA. This may result in visual artifacts, like cut-off or duplicated labels.

Serving satellite imagery as background data.

WMSImageModel

The LuciadRIA map sends an image request to the WMS server each time you pan or zoom the map.

High quality and fidelity

The WMS server will generate an image that corresponds exactly to the size and the scale level of the map.

Slower

When you navigate the map, the current WMS image is discarded, and you have to wait for the WMS server to update the map with a new image. The selected image format has a significant impact on performance.

Not supported on WebGL maps

  • Rendering a WMS layer with labels

  • Visualizing WMS data for which very accurate, scale-level-dependent styling has been defined.

You can try out both the tiled and non-tiled visualization approach in the Data Formats sample.

If you are using a hardware-accelerated WebGL map, you can only select a WMS tileset model. You can associate any coordinate reference system with the model. On a 2D WebGL map, it is recommended to choose the map reference for the highest quality. On a 3D WebGL map, it is recommended to use the WGS-84 reference.

If you are using a map that is not hardware-accelerated, you can choose between a WMS tileset or image model. The reference associated with the WMS model must be the same as the map reference.

Visualizing WMS data quickly

The fastest way to visualize image raster data is by tiling the data. The WMSTilesetModel defines a multi-leveled tile structure on top of the WMS. WMS is not tiled by nature, but LuciadRIA can still render WMS data in a tiled way. When it visualizes the WMSTileSetModel in a RasterTileSetLayer, LuciadRIA will define a quad tree tile structure on your WMS data. Depending on your view parameters for scale and view extent, LuciadRIA will calculate what tiles are in the view. Next, it loads images from the WMS server that correspond with the size (in pixels) and bounds of the tiles.

The advantage of this approach that LuciadRIA can cache those WMS images. When you pan or zoom the map, a large number of tiles can typically be re-used, which results in a much more interactive map. Only tiles that were not cached and were not visible before you navigated the map must be downloaded from the WMS server.

The disadvantage of WMS data tiling is that it reduces the quality of the raster data and may result in strange visual artifacts. For example:

  • Only defined tile levels will be shown. If you navigate the map to a scale level that sits between two tile levels, LuciadRIA will render the tile level closest to that scale level. If your WMS server applies a distinct style level at that map scale, the visualization results may not be what you expect. In that case, you should use a WMSImageModel.

  • WMS is not aware of the tiling structure imposed by LuciadRIA. If the generated WMS image contains labels, these labels may be located in a different position on two adjacent tiles. This might result in unwanted artifacts where labels are cut off at the tiling boundary, or labels for a single object appear multiple times.

If you use a Luciad WMS server, you have several options for reducing or preventing those effects: you can use label placers that avoid placing a label that crosses the boundary of a map request or that place only one label for a given feature, and place it always at its focus point for example.

Visualizing WMS data with high quality

To visualize WMS data in LuciadRIA with the best possible quality, use a WMSImageModel in combination with a WMSImageLayer. If you use those components, the LuciadRIA map will send a request to the WMS server each time you pan or zoom the map.

The advantage of this approach is that it yields the best visualization fidelity. The WMS server will generate an image that corresponds exactly to the scale level of the map, given the size (width and height in pixels) of your map and the mapBounds that you want to see.

The disadvantage is reduced performance: the WMS image displayed before you navigated the map is discarded because it can no longer be used. Depending on the speed at which the WMS server can render images, you may have to wait a significant amount of time before the map is updated.

Also note that the selected image format has a significant impact on performance. For example, encoding to image/jpeg is typically a lot faster than encoding to image/png. Therefore, image/jpeg is the preferred format for satellite imagery without transparent sections.

Choosing a WMS visualization strategy based on the nature of your data

These are some guidelines for choosing a strategy based on the type and purpose of the data you want to display:

  • If you use WMS to serve satellite imagery as background data, you’re better off using a tiled visualization approach.

  • If your WMS layer is rendered with labels, you’re better off using an image approach.

  • If you have very accurate, scale-level-dependent styling in place for your WMS data, you’re better off using an image approach. The tiling visualization approach only shows data at pre-defined scale levels and does not generate images in between tile levels. You cannot choose the scale levels that the WMSTileSetModel will generate.

Using BASE layers in your map

LuciadRIA allows you to define a layer type on a layer. If you add a RasterTileSetLayer with LayerType BASE to the map, the map will always snap to a tile level when you zoom in and out on the map. As a result, the background raster data will be rendered with the best visual quality, because LuciadRIA does not scale the tiles.

Vector data on top of the base layer will be rendered accurately. Raster layers on top of the base layer may be scaled, however, if their tile tree structure does not correspond with the tile tree structure of the base layer. The tile tree structure is determined by the bounds of the model, the size of the tiles, and the amount of tile rows and columns at tile level 0.