Some data formats come with their own dedicated, domain-specific styling, for example AIXM, DGN or DWG data. For such data, you typically don’t want to define an SLD style: you just want to keep using the default styling, but you still want to use SLD to restrict the data to a specific range of map scales.
This article explains how you can do that by assigning an SLD style that only defines a scale range, without any symbolizer.
Defining an SLD with a scale range only
A regular SLD rule combines a scale range with one or more symbolizers that define the styling to apply within that range.
If you leave out the symbolizer, and the SLD contains exactly one FeatureTypeStyle with exactly one Rule, the WMS server still gives any configured SLD layer factories the opportunity to handle the style first.
Only if none of them does, it falls back to the default, domain-specific styling for the data, while still restricting it
to the scale range defined by the rule:
<FeatureTypeStyle>
<Rule>
<Name>Scale range only</Name>
<MinScaleDenominator>500000.0</MinScaleDenominator>
<MaxScaleDenominator>1000000.0</MaxScaleDenominator>
</Rule>
</FeatureTypeStyle>
MinScaleDenominator and MaxScaleDenominator are both optional, and default to 0 and unbounded respectively, just as in a regular SLD rule.
|
This fallback only applies to a style with a single |
Assigning the style to your data
You assign a scale-range-only SLD style to your data in the same way as any other SLD style:
-
Upload the
.sldfile containing the style shown in this SLD rule to LuciadFusion Studio. LuciadFusion automatically creates aStyleresource from the file. -
If you haven’t done so already, add the data that you want to restrict to a LuciadFusion product.
-
Open the product, and associate the uploaded style with the data in its style set. If you want to offer the style as a separate named style next to the default styling, add it as a new style set instead of replacing the default one.
For more background information on assigning styles to data in LuciadFusion Studio, see How to customize the styling of your data.
Effect on the WMS service
Once the style is assigned, the WMS layer for the data behaves as follows:
-
GetMapandGetFeatureInforequests that use this style render and query the data using its regular, domain-specific styling, but only within the configured scale range. Outside that range, the layer renders nothing for this style. -
The scale range is advertised in the WMS
GetCapabilitiesresponse for the corresponding layer and style through itsMinScaleDenominator/MaxScaleDenominatorelements. WMS clients can therefore find out about the scale range up front, without having to issue a request first.
You can now apply SLD-based scale filtering for domain-specific data formats, without having to give up their built-in styling.
|
This scale range restriction, and its If you instead supply the same empty-style SLD directly in a WMS request through the |
For more information about SLD styling in general, see Styling data with OGC SLD. For examples of combining a scale range with explicit styling rules, see How to render only a raster outline outside a raster scale range and How to style roads.