public class TLspRasterLayerBuilder extends ALspLayerBuilder
ILspLayer
instances that visualize
raster data.
The following object types and models are supported:
ALcdImage
or has-a-image
objects and an ILcdImageModelDescriptor
ILcdRaster
objects and a TLcdRasterModelDescriptor
ILcdMultilevelRaster
objects and a TLcdMultilevelRasterModelDescriptor
ILcdEarthTileSet
objects, provided they have a coverage
of type
IMAGE
,
ELEVATION
, or
MULTIVALUED
and an ILcdEarthModelDescriptor
geometry
of one of the
supported types.
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:
TLspRasterStyle
instance: mandatory, this controls the visualization of the raster valuesTLspImageProcessingStyle
instance: an image processing operator chain applied to the rasterTLspLineStyle
instance: this controls the style of the outline of the bounds of
the rasterTLspFillStyle
instance: this controls the style of the fill of the bounds of
the rasterTLspRasterStyle.getStartResolutionFactor()
).
Otherwise the bounds of the raster are painted instead.ILspCustomizableStyler
is configured that exposes the TLspRasterStyle
and bounds related styles mentioned above.
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:
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.
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 changeILcdEarthTileSet
's or equivalent
ALcdMultilevelImageMosaic
'sstatus
to know
when it is processing changes.
Modifier and Type | Method and Description |
---|---|
TLspRasterLayerBuilder |
borderFactor(double aBorderFactor)
Sets the size of the surplus border that is processed, relative to the view.
|
TLspRasterLayerBuilder |
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.
|
ILspEditableStyledLayer |
build()
Creates a new layer instance.
|
TLspRasterLayerBuilder |
filter(ILcdDynamicFilter aFilter)
Sets a filter that will be used to filter objects to prevent them from
being painted by the layer.
|
TLspRasterLayerBuilder |
icon(ILcdIcon aIcon)
Sets the icon of the layer.
|
TLspRasterLayerBuilder |
incrementalPainting(boolean aIncrementalPainting)
Sets whether the layer is repainted as soon as a tile becomes available.
|
TLspRasterLayerBuilder |
label(String aLabel)
Sets the label of the layer.
|
TLspRasterLayerBuilder |
layerStyle(TLspLayerStyle aLayerStyle)
Set a layer style to be used during the rendering of the layer.
|
TLspRasterLayerBuilder |
layerType(ILspLayer.LayerType aLayerType)
Sets the layer type.
|
TLspRasterLayerBuilder |
mapScaleRange(TLcdDimensionInterval<TLcdMapScale> aScaleRange)
Sets the scale range of the layer in unitless map scale ratios.
|
TLspRasterLayerBuilder |
model(ILcdModel aModel)
Sets the model.
|
static TLspRasterLayerBuilder |
newBuilder() |
TLspRasterLayerBuilder |
sldStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle)
Use the styling defined in
aFeatureTypeStyle to style the layer under creation. |
TLspRasterLayerBuilder |
styler(TLspPaintRepresentationState aPaintRepresentationState,
ILspStyler aStyler)
Sets the styler of the raster.
|
getIcon, getLabel, getLayerStyle, getLayerType, getModel
public static TLspRasterLayerBuilder newBuilder()
public TLspRasterLayerBuilder styler(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler)
TLspPaintRepresentation#BODY
affects the style of the raster. There is one exception: when using a TLspParameterizedRasterIconStyle
, the
LABEL
paint representation should be used.
Refer to the class 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). See
TLspRasterStyle.Builder
for details.aPaintRepresentationState
- the paint representation.aStyler
- the stylerpublic ILspEditableStyledLayer build()
ALspLayerBuilder
Creates a new layer instance.
build
in class ALspLayerBuilder
public TLspRasterLayerBuilder model(ILcdModel aModel)
ALcdImage
or has-a-image
objects and an ILcdImageModelDescriptor
ILcdRaster
objects and a TLcdRasterModelDescriptor
ILcdMultilevelRaster
objects and a TLcdMultilevelRasterModelDescriptor
ILcdEarthTileSet
objects, provided they have a coverage
of type
IMAGE
,
ELEVATION
, or
MULTIVALUED
and an ILcdEarthModelDescriptor
geometry
of one of the
supported types.model
in class ALspLayerBuilder
aModel
- a raster modelIllegalArgumentException
- if aModel
is not a supported raster modelILcdLayer.getModel()
public TLspRasterLayerBuilder label(String aLabel)
ALspLayerBuilder
null
.label
in class ALspLayerBuilder
aLabel
- the labelILcdLayer.getLabel()
public TLspRasterLayerBuilder layerType(ILspLayer.LayerType aLayerType)
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 changeILspLayer.LayerType.INTERACTIVE
otherwise.layerType
in class ALspLayerBuilder
aLayerType
- the new layer typeILspLayer.getLayerType()
public TLspRasterLayerBuilder icon(ILcdIcon aIcon)
ALspLayerBuilder
null
.icon
in class ALspLayerBuilder
aIcon
- the iconILcdLayer.getIcon()
public TLspRasterLayerBuilder layerStyle(TLspLayerStyle aLayerStyle)
ALspLayerBuilder
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 calling
ILspLayer.setLayerStyle(TLspLayerStyle)
.layerStyle
in class ALspLayerBuilder
aLayerStyle
- the layer style. Must not be null
. If you want to set the default layer style, set TLspLayerStyle.newBuilder().build()
ILspLayer.getLayerStyle()
,
ILspLayer.setLayerStyle(TLspLayerStyle)
public TLspRasterLayerBuilder filter(ILcdDynamicFilter aFilter)
aFilter
- the filterthis
public TLspRasterLayerBuilder borderFactor(double aBorderFactor)
0.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.aBorderFactor
- the relative amount by which the view is enlarged on each sidethis
public TLspRasterLayerBuilder borderFactor(double aBorderFactor, boolean aIncludeTextureLoading)
0.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.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.this
public TLspRasterLayerBuilder incrementalPainting(boolean aIncrementalPainting)
aIncrementalPainting
- boolean indicating whether the layer is repainted as soon as a tile becomes available.this
public TLspRasterLayerBuilder sldStyle(TLcdSLDFeatureTypeStyle aFeatureTypeStyle)
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.
aFeatureTypeStyle
- The feature type stylepublic TLspRasterLayerBuilder mapScaleRange(TLcdDimensionInterval<TLcdMapScale> aScaleRange)
aScaleRange
- the scale range for the layerthis
TLcdMapScale.createScaleRange(TLcdMapScale, TLcdMapScale)