Class TLspRasterLayerBuilder
ILspLayer
instances that visualize
raster data.
Supported data
The following object types and models are supported:
ALcdImage
orhas-a-image
objects and anILcdImageModelDescriptor
ILcdRaster
objects and aTLcdRasterModelDescriptor
ILcdMultilevelRaster
objects and aTLcdMultilevelRasterModelDescriptor
ILcdEarthTileSet
objects, provided they have a coverage of typeIMAGE
,ELEVATION
, orMULTIVALUED
and anILcdEarthModelDescriptor
geometry
of one of the
supported types.
Styling color and elevation data
By default, color data is visualized using the image's own color model.
Elevation data is visualized with a DTED color mapping.
The visualization of the raster data can be configured by setting a styler
.
The styler can submit the following styles:
- a
TLspRasterStyle
instance: mandatory, this controls the visualization of the raster values - a
TLspImageProcessingStyle
instance: an image processing operator chain applied to the raster - a
TLspLineStyle
instance: this controls the style of the outline of the bounds of the raster - a
TLspFillStyle
instance: this controls the style of the fill of the bounds of the raster
TLspRasterStyle.getStartResolutionFactor()
).
Otherwise the bounds of the raster are painted instead.If no custom styler is specified, an
ILspCustomizableStyler
is configured that exposes the TLspRasterStyle
and bounds related styles mentioned above.
Styling parameterized image data
Images or parameterized
data from Earth tilesets can be visualized using an icon grid. This can be configured by using a
TLspParameterizedRasterIconStyle
as the styler
.
When using one dimensional parameterized
data from Earth tile, a default visualization is chosen, depending on the parameter and unit:
- for angles, an arrow icon grid is used
- for Kelvin (K), Celsius (C), Percentage (%), and proportion, a specific color mapping is chosen
TLspParameterizedRasterIconStyle
.
Icon grid layers internally use the LABEL
paint representation. The label
representation is used because this ensures the icons are always visible and never clipped by terrain in a 3D view.
Thus, when configuring a layer with a TLspParameterizedRasterIconStyle
, you should use the label paint
representation, not the body paint representation. Additionally, if you need to interact with an icon grid layer
after it has been created, you will have to refer to the label paint representation.
Interactive layers
The behavior of the raster layer may also be influenced by the layer type
that is set:
ILspLayer.LayerType.INTERACTIVE
: indicates that the layer should support smooth interaction, such as changes of the visibility, styling or model elementsILspLayer.LayerType.BACKGROUND
: indicates that the raster is used as background data in the view and will rarely change
Limitations
The most important limitations are:- When changing a raster layer, may temporarily not paint anything in the view until the change has been processed in the following situations:
- any change to a layer of type background
- model changes and style changes that affect the geometry for
ILcdEarthTileSet
's or equivalentALcdMultilevelImageMosaic
's - Style target providers are not supported for layers of type background.
status
to know
when it is processing changes.
- Since:
- 2012.0
-
Method Summary
Modifier and TypeMethodDescriptionborderFactor
(double aBorderFactor) Sets the size of the surplus border that is processed, relative to the view.borderFactor
(double aBorderFactor, boolean aIncludeTextureLoading) Sets the size of the surplus border that is processed, relative to the view, along with whether texture data loading should be included in this surplus processing.build()
Creates a new layer instance.filter
(ILcdDynamicFilter aFilter) Sets a filter that will be used to filter objects to prevent them from being painted by the layer.Sets the icon of the layer.incrementalPainting
(boolean aIncrementalPainting) Sets whether the layer is repainted as soon as a tile becomes available.Sets the label of the layer.layerStyle
(TLspLayerStyle aLayerStyle) Set a layer style to be used during the rendering of the layer.layerType
(ILspLayer.LayerType aLayerType) Sets the layer type.mapScaleRange
(TLcdDimensionInterval<TLcdMapScale> aScaleRange) Sets the scale range of the layer in unitless map scale ratios.Sets the model.static TLspRasterLayerBuilder
sldStyle
(TLcdSLDFeatureTypeStyle aFeatureTypeStyle) Use the styling defined inaFeatureTypeStyle
to style the layer under creation.styler
(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler of the raster.Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayerBuilder
getIcon, getLabel, getLayerStyle, getLayerType, getModel
-
Method Details
-
newBuilder
- Returns:
- a new raster layer builder with the default settings
-
styler
public TLspRasterLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler of the raster. Only theTLspPaintRepresentation#BODY
affects the style of the raster. There is one exception: when using aTLspParameterizedRasterIconStyle
, theLABEL
paint representation should be used. Refer to theclass javadoc
for an overview of the supported styles. The default styler drapes the raster data on top of the view's terrain and paints a red hatched rectangle when zoom out too far. For a raster with color data you can reproduce its behavior with the following styler:new TLspStyler( TLspLineStyle.newBuilder().color(Color.RED).build(), TLspFillStyle.newBuilder().color(Color.RED).stipplePattern(TLspFillStyle.StipplePattern.HATCHED).build(), TLspRasterStyle.newBuilder().build() );
Note that some additional configuration is needed for non-color data (ex. elevation data). SeeTLspRasterStyle.Builder
for details.- Parameters:
aPaintRepresentationState
- the paint representation.aStyler
- the styler- Returns:
- this builder
-
build
Description copied from class:ALspLayerBuilder
Creates a new layer instance.
- Specified by:
build
in classALspLayerBuilder
- Returns:
- the new layer instance
-
model
Sets the model. The following object types and models are supported:ALcdImage
orhas-a-image
objects and anILcdImageModelDescriptor
ILcdRaster
objects and aTLcdRasterModelDescriptor
ILcdMultilevelRaster
objects and aTLcdMultilevelRasterModelDescriptor
ILcdEarthTileSet
objects, provided they have a coverage of typeIMAGE
,ELEVATION
, orMULTIVALUED
and anILcdEarthModelDescriptor
geometry
of one of the supported types.- Overrides:
model
in classALspLayerBuilder
- Parameters:
aModel
- a raster model- Returns:
- this builder
- Throws:
IllegalArgumentException
- ifaModel
is not a supported raster model- See Also:
-
label
Description copied from class:ALspLayerBuilder
Sets the label of the layer. This is a short textual representation for it, often used to represent the layer to end-users. The default value isnull
.- Overrides:
label
in classALspLayerBuilder
- Parameters:
aLabel
- the label- Returns:
- this builder
- See Also:
-
layerType
Sets the layer type. The layer type should be one of the following:ILspLayer.LayerType.INTERACTIVE
: the layer indicates that the layer should support smooth interaction, such as changes of the visibility or style of the raster dataILspLayer.LayerType.BACKGROUND
: indicates that the raster is used as background data in the view and will rarely change
ILspLayer.LayerType.INTERACTIVE
otherwise.- Overrides:
layerType
in classALspLayerBuilder
- Parameters:
aLayerType
- the new layer type- Returns:
- this builder
- See Also:
-
icon
Description copied from class:ALspLayerBuilder
Sets the icon of the layer. The default value isnull
.- Overrides:
icon
in classALspLayerBuilder
- Parameters:
aIcon
- the icon- Returns:
- this builder
- See Also:
-
layerStyle
Description copied from class:ALspLayerBuilder
Set a layer style to be used during the rendering of the layer.TLspLayerStyle
is used to style the layer as a whole. Layer style can for example modify the transparency of a layer. Also, layer style can be modified after building the layer by callingILspLayer.setLayerStyle(TLspLayerStyle)
.- Overrides:
layerStyle
in classALspLayerBuilder
- Parameters:
aLayerStyle
- the layer style. Must not benull
. If you want to set the default layer style, setTLspLayerStyle.newBuilder().build()
- Returns:
- this
- See Also:
-
filter
Sets a filter that will be used to filter objects to prevent them from being painted by the layer. No filter is set by default.- Parameters:
aFilter
- the filter- Returns:
this
-
borderFactor
Sets the size of the surplus border that is processed, relative to the view. A high value increases the memory usage and cpu usage, but will often give faster updates for small pan and zoom operations. The default value is0.25
which results in 25% extra data on all sides, so the total processed area is 2.25x the area when using no surplus border.- Parameters:
aBorderFactor
- the relative amount by which the view is enlarged on each side- Returns:
this
-
borderFactor
Sets the size of the surplus border that is processed, relative to the view, along with whether texture data loading should be included in this surplus processing. A high border factor increases the memory and cpu usage, but will often give faster updates for small pan and zoom operations. The default border factor is0.25
which results in 25% extra data on all sides, so the total processed area is 2.25x the area when using no surplus border. By default, texture loading is not included in the surplus processing. Including it increases the memory and cpu usage even more, but will often give faster updates for small pan and zoom operations.- Parameters:
aBorderFactor
- the relative amount by which the view is enlarged on each sideaIncludeTextureLoading
- indicates whether texture data loading should be included in the surplus processing.- Returns:
this
- Since:
- 2018.2
-
incrementalPainting
Sets whether the layer is repainted as soon as a tile becomes available. When set to false, the layer is not updated until all tiles are ready. By default, this property is set to true.- Parameters:
aIncrementalPainting
- boolean indicating whether the layer is repainted as soon as a tile becomes available.- Returns:
this
- Since:
- 2018.1
-
sldStyle
Use the styling defined in
aFeatureTypeStyle
to style the layer under creation. All relevant settings on the layer will be adjusted to match the info contained in the SLD style.Calling this method will is the equivalent of calling (in pseudo-code):
TLspSLDStyler styler = new TLspSLDStyler(aFeatureTypeStyle); builder.styler(TLspPaintRepresentationState.REGULAR_BODY, styler);
Note that in future versions of the product it is possible that this method will overwrite more settings.
- Parameters:
aFeatureTypeStyle
- The feature type style- Returns:
- this builder
- Since:
- 2017.0
-
mapScaleRange
Sets the scale range of the layer in unitless map scale ratios. This property defines a range of scales in which the layer is visible. By default, no scale range is used, meaning that the layer is always visible.- Parameters:
aScaleRange
- the scale range for the layer- Returns:
this
- Since:
- 2021.1
- See Also:
-