The LuciadLightspeed WMS client and LuciadFusion WMS server support the use of SLD styles in WMS requests. A WMS client can use this capability to customize the styling of data published in a WMS layer. By default, an SLD style contains generic styling settings for vector and raster data. LuciadLightspeed and LuciadFusion extend this SLD styling capability by also supporting SLD styles with S-52 and S-101 display settings for ECDIS data:
-
S-52 display settings configure the styling of ECDIS S-57 data.
-
S-101 display settings configure the styling of ECDIS S-101 data.
Because of that support, WMS clients can customize the styling of ECDIS S-57 or S-101 data published in a WMS layer.
Working with S-52 and S-101 display settings
Maritime ECDIS data is typically rendered according to International Hydrographic Organisation (IHO) specifications:
-
The S-52 specification guides the display of S-57 data
-
The S-101 specification guides the display of S-101 data.
These specifications define a set of parameters that you can use to optimize the displaying of maritime data for a specific environment. These parameters include color scheme settings, a detailed list of icons and line styles, ship depth settings, several object filters, and other customizations.
In an end user application, where the client application renders the data, you provide these settings directly to the rendering engine.
In a client-server setup though, a remote server renders the data. You must pass these parameters from the client to the server, so that the server can render its images according to the client’s preferences.
Neither the WMS specification nor the SLD specification offer out-of-the-box support for the modeling of S-52 or S-101 parameters. This lack of support makes it impossible to use this type of customization in a default WMS client-server setup. For that reason, LuciadLightspeed and LuciadFusion define a custom SLD extension for the exchange of S-52 and S-101 display settings between WMS clients and servers.
Embedding S-52 or S-101 display settings in a WMS GetMap request using SLD
The WMS protocol allows embedding an SLD style in a GetMap request.
You can use such an embedded SLD style to pass custom styling parameters to a WMS server, and tell the WMS server how to render
its images.
LuciadLightspeed and LuciadFusion use this styling mechanism to support S-52 and S-101 styling customizations, through a custom
S-52 and S-101 SLD extension.
Embed S-52 or S-101 display settings using LuciadLightspeed with the optional Maritime Standards component
|
To access ECDIS S-52 and S-101 functionality, you must have the optional Maritime Standards component available in your LuciadLightspeed installation. |
You can use the dedicated S-52 / S-101 API and domain model in LuciadLightspeed to define S-52 or S-101 display settings.
This API allows you to customize the S-52 and S-101 visualization, using the TLcdS52DisplaySettings and TLcdS101DisplaySettings classes respectively.
To embed an object of this class in a valid WMS GetMap request:
-
Create and configure an S-52 or S-101 display settings object using
TLcdS52DisplaySettingsorTLcdS101DisplaySettings. In the samples of the Maritime Standards component, the display settings are configured through the user interface, using theS52DisplaySettingsCustomizerandS101DisplaySettingsCustomizerclasses. -
Once the configuration is complete, embed the S-52 or S-101 display settings object respectively in an
TLcdS52SLDSymbolizerorTLcdS101SLDSymbolizer. The symbolizer is itself embedded in an SLD Feature Type Style.TLcdS52SLDSymbolizer symbolizer = new TLcdS52SLDSymbolizer(); symbolizer.setDisplaySettings(displaySettings); TLcdSLDRule rule = new TLcdSLDRule(); rule.addSymbolizer(symbolizer); TLcdSLDFeatureTypeStyle featureTypeStyle = new TLcdSLDFeatureTypeStyle(); featureTypeStyle.addRule(rule); -
Create a Styled Layer Descriptor, and add an SLD Named Layer to it for each WMS layer that you want to include in your
GetMaprequest. The SLD Named Layer has a reference to the created Feature Type Style through an SLD User Style.TLcdSLDUserStyle layerStyle = new TLcdSLDUserStyle(); layerStyle.setDefault(true); layerStyle.addFeatureTypeStyle(featureTypeStyle); TLcdSLDNamedLayer layer = new TLcdSLDNamedLayer(); layer.setName(ecdisWMSLayer.getNamedLayerName()); layer.addLayerStyle(layerStyle); TLcdSLDStyledLayerDescriptor styledLayerDescriptor = new TLcdSLDStyledLayerDescriptor(); styledLayerDescriptor.addLayer(layer); -
Set the Styled Layer Descriptor on the
ALcdWMSProxyobject, using thesetStyledLayerDescriptor()method, so that the WMS client includes the S-52 or S-101 SLD style in yourGetMaprequests.
Detecting which WMS layers support S-52 and S-101 SLD styling
A WMS server may serve a mixed set of layers: some layers contain ECDIS data, others contain different sorts of data. To allow WMS clients to discover which layers support S-52 or S-101 SLD styling, LuciadFusion WMS servers include keywords in the layer description:
-
The
S52-SLDkeyword for ENC and SENC data -
The
AML-SLDkeyword for AML data, which also supports S-52 SLD styling -
The
S101-SLDkeyword for S-101 data
Such a layer description is provided for each layer in the response to a GetCapabilities request.
Program: Detection of WMS layers supporting the S-52 or S-101 SLD styling extension shows an example of how to detect whether a WMS layer supports S-52 or S-101 SLD styling.
private static final List<String> ECDIS_SLD_KEYWORDS = Arrays.asList("S52-SLD", "AML-SLD", "S101-SLD");
private static boolean ecdisSLDWMSLayer(ALcdWMSNamedLayer aLayer) {
for (int i = 0; i < aLayer.getKeywordCount(); i++) {
if (ECDIS_SLD_KEYWORDS.contains(aLayer.getKeyword(i))) {
return true;
}
}
return false;
}