Class TLspRasterLayer
- All Implemented Interfaces:
ILcdPropertyChangeSource
,ILcdSelection<Object>
,ILcdLayer
,ILspEditableStyledLayer
,ILspLayer
,ILspStyledLayer
,Serializable
ILspView
.
Supported data
The following object types and models are supported:
ALcdImage
orhas-an-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 level switch factor applies to multi-leveled data.
By default, multi-level images uses a level switch factor of 0.3.
For multi-level image mosaics, the default depends on the mosaic tile size.
A mosaic tile size of 256x256 or larger results in a level switch factor of 0.3.
For smaller mosaic tile sizes, the level switch factor is reduced correspondingly.
By reducing the level switch, we aim for an equal amount of tiles needed to fill a view.
To compensate for pixelation effects due to a reduced level switch factor, linear interpolation is enabled by
default.
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.
Styling parameterized raster data
One dimensional parameterized
data from Earth tilesets
is visualized 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
The visualization of the this data can be configured by setting a TLspParameterizedRasterIconStyle
as the styler
.
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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.layer.ILspLayer
ILspLayer.LayerType
-
Constructor Summary
ConstructorDescriptionTLspRasterLayer
(ILcdModel aModel) Constructs a new raster layer for the given model.TLspRasterLayer
(ILcdModel aModel, ILspLayer.LayerType aLayerType) Constructs a new raster layer with the given model and layer type.TLspRasterLayer
(ILcdModel aModel, String aLabel) Constructs a new raster layer with the given model and label.TLspRasterLayer
(ILcdModel aModel, String aLabel, ILspLayer.LayerType aLayerType) Constructs a new raster layer with the given model, label and layer type. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
configureForSLDStyling
(TLcdSLDFeatureTypeStyle aSLDFeatureTypeStyle) Style this layer using the specified SLD style.void
fireStatusEvent
(TLcdStatusEvent<ILspLayer> aStatusEvent) Fires a status event.double
Returns the size of the surplus border that is processed, relative to the view.long
Returns the size of the private cache.Returns the layer type.The raster layer only supports theTLspPaintRepresentation.BODY
paint representation.getStyler
(TLspPaintRepresentationState aPaintRepresentationState) Returns the styler that is used for the given paint representation state.boolean
Returnstrue
if the layer supports editing its objects.boolean
Returns whether this layer is repainted as soon as a tile becomes available.boolean
Returns whether the surplus processing indicated by theborder factor
includes texture data loading.boolean
Returnstrue
if this layer supports selecting objects,false
otherwise.boolean
<T> T
query
(ALspPaintQuery<T> aQuery, TLspContext aContext) Retrieves a set of domain objects and data based on the parameters given by the query.void
registerView
(ILspView aView) Registers a view with this layer.void
setBorderFactor
(double aBorderFactor) Returns the size of the surplus border that is processed, relative to the view.void
setCacheSize
(long aCacheSize) Sets the size of the private cache.void
setIncrementalPainting
(boolean aIncrementalPainting) Sets whether this layer is repainted as soon as a tile becomes available.void
setLayerType
(ILspLayer.LayerType aLayerType) Sets the layer type for this layer.void
setLoadTexturesInBorder
(boolean aLoadTexturesInBorder) Sets whether the surplus processing indicated by theborder factor
should also include texture data loading.void
setStyler
(TLspPaintRepresentationState aPaintRepresentationState, ILspStyler aStyler) Sets the styler used to style the rasters contained by this layer.void
setUseSharedCache
(boolean aUseSharedCache) Sets whether the shared cache is used to cache raster data.toString()
Methods inherited from class com.luciad.view.lightspeed.layer.ALspLayer
addLayerStateListener, addPaintRepresentation, addPropertyChangeListener, addSelectionListener, addStatusListener, clearSelection, createModelXYZWorldTransformation, fireCollectedSelectionChanges, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, firePropertyChange, getBounds, getCurrentViews, getFilter, getIcon, getLabel, getLayerStyle, getMapScaleRange, getModel, getModelXYZWorldTransformation, getSelectionCount, invalidate, isEditable, isEditable, isSelectable, isSelected, isSynchronous, isVisible, isVisible, isVisible, removeLayerStateListener, removePaintRepresentation, removePropertyChangeListener, removeSelectionListener, removeStatusListener, selectedObjects, selectObject, selectObjects, setEditable, setEditable, setFilter, setIcon, setLabel, setLayerStyle, setMapScaleRange, setModel, setSelectable, setSynchronous, setVisible, setVisible, setVisible, unregisterView
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.luciad.view.ILcdLayer
clearSelection, fireCollectedSelectionChanges, getIcon, getLabel, getModel, isEditable, isSelectable, isVisible, selectObject, setIcon, setLabel, setSelectable
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
Methods inherited from interface com.luciad.util.ILcdSelection
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
Methods inherited from interface com.luciad.view.lightspeed.layer.ILspLayer
addLayerStateListener, addStatusListener, getBounds, getCurrentViews, getLayerStyle, getMapScaleProvider, getModelXYZWorldTransformation, invalidate, isEditable, isVisible, isVisible, removeLayerStateListener, removeStatusListener, setEditable, setEditable, setLayerStyle, setVisible, setVisible, setVisible, unregisterView
-
Constructor Details
-
TLspRasterLayer
Constructs a new raster layer for the given model. The display name of the model's descriptor is used as the layer label.- Parameters:
aModel
- the model to be assigned to this raster layer
-
TLspRasterLayer
Constructs a new raster layer with the given model and label.- Parameters:
aModel
- the model to be assigned to this raster layeraLabel
- the label to be assigned to this raster layer
-
TLspRasterLayer
Constructs a new raster layer with the given model and layer type. Note that not all layer types aresupported
.- Parameters:
aModel
- the model to be assigned to this raster layeraLayerType
- the layer type to be assigned to this raster layer
-
TLspRasterLayer
Constructs a new raster layer with the given model, label and layer type. Note that not all layer types aresupported
.- Parameters:
aModel
- the model to be assigned to this raster layeraLabel
- the label to be assigned to this raster layeraLayerType
- the layer type
-
-
Method Details
-
getPaintRepresentations
The raster layer only supports theTLspPaintRepresentation.BODY
paint representation.- Specified by:
getPaintRepresentations
in interfaceILspLayer
- Overrides:
getPaintRepresentations
in classALspLayer
- Returns:
- a collection of
PaintRepresentation
s, nevernull
-
isEditableSupported
public boolean isEditableSupported()Returnstrue
if the layer supports editing its objects.- Specified by:
isEditableSupported
in interfaceILcdLayer
- Overrides:
isEditableSupported
in classALspLayer
- Returns:
false
- See Also:
-
isSelectableSupported
public boolean isSelectableSupported()Returnstrue
if this layer supports selecting objects,false
otherwise.- Specified by:
isSelectableSupported
in interfaceILcdLayer
- Overrides:
isSelectableSupported
in classALspLayer
- Returns:
false
- See Also:
-
setLayerType
Sets the layer type for this layer. 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.- Parameters:
aLayerType
- the layer type
-
getLayerType
Returns the layer type. The default layer type- Specified by:
getLayerType
in interfaceILspLayer
- Overrides:
getLayerType
in classALspLayer
- Returns:
- the layer type
- See Also:
-
getCacheSize
public long getCacheSize()Returns the size of the private cache.- Returns:
- the size of the private cache (in bytes)
- See Also:
-
setCacheSize
public void setCacheSize(long aCacheSize) Sets the size of the private cache. The size is not relevant if the shared cache is used. If the shared cache is not used, data that is not strictly needed for the current view will be cache as long as the total cached data (that is including the data that is needed for the current view) does not exceed the specified number of bytes. Data that is needed for the current view will always be cached, even if it exceeds the specified number of bytes.- Parameters:
aCacheSize
- the size of the private cache (in bytes)- See Also:
-
getBorderFactor
public double getBorderFactor()Returns the size of the surplus border that is processed, relative to the view.- Returns:
- the relative amount by which the view is enlarged on each side
- See Also:
-
setBorderFactor
public void setBorderFactor(double aBorderFactor) Returns 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. Note that, 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. To include it, seesetLoadTexturesInBorder(boolean)
.- Parameters:
aBorderFactor
- the relative amount by which the view is enlarged on each side
-
isLoadTexturesInBorder
public boolean isLoadTexturesInBorder()Returns whether the surplus processing indicated by theborder factor
includes texture data loading.- Returns:
- whether texture data loading should be included in the surplus processing.
- Since:
- 2018.2
- See Also:
-
setLoadTexturesInBorder
public void setLoadTexturesInBorder(boolean aLoadTexturesInBorder) Sets whether the surplus processing indicated by theborder factor
should also include texture data loading. By default, texture loading is not included in the surplus processing. Including it increases the memory and cpu usage even more than a border factor that does not include texture loading, but will often give faster updates for small pan and zoom operations.- Parameters:
aLoadTexturesInBorder
- whether texture data loading should be included in the surplus border processing.- Since:
- 2018.2
- See Also:
-
isIncrementalPainting
public boolean isIncrementalPainting()Returns whether this layer is repainted as soon as a tile becomes available.- Returns:
- whether this layer is repainted as soon as a tile becomes available.
- Since:
- 2018.1
- See Also:
-
setIncrementalPainting
public void setIncrementalPainting(boolean aIncrementalPainting) Sets whether this layer is repainted as soon as a tile becomes available. When set to false, this layer is not updated until all tiles are ready. By default, this property is set to true.- Parameters:
aIncrementalPainting
- boolean indicating whether this layer is repainted as soon as a tile becomes available.- Since:
- 2018.1
-
getStyler
Description copied from interface:ILspStyledLayer
Returns the styler that is used for the given paint representation state.- Specified by:
getStyler
in interfaceILspStyledLayer
- Parameters:
aPaintRepresentationState
- the paint representation state for which the styler should be retrieved- Returns:
- the styler used for the given paint representation state
-
setStyler
Sets the styler used to style the rasters contained by this layer. Only theTLspPaintRepresentation.BODY
affects the style of the raster. The styler should submit:- a
TLspRasterStyle
instance: mandatory, this controls the style of the raster values - a
TLspImageProcessingStyle
instance: a 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. 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.- Specified by:
setStyler
in interfaceILspEditableStyledLayer
- Parameters:
aPaintRepresentationState
- the paint representation stateaStyler
- the styler
- a
-
query
Retrieves a set of domain objects and data based on the parameters given by the query. The following queries are supported:TLspPaintedObjectsTouchQuery
: the result can be aTLspRasterWorldTouchInfo
combined
with the view's terrain are not included in this query. You can useILspTerrainSupport
instead to query these.- Type Parameters:
T
- the type of the return value ofALspPaintQuery.getResult()
- Parameters:
aQuery
- the queryaContext
- the context- Returns:
- the value returned by
ALspPaintQuery.getResult()
after processing is finished - Throws:
UnsupportedOperationException
- if an aspect of the query is not supported by this layer
-
fireStatusEvent
Description copied from class:ALspLayer
Fires a status event.- Overrides:
fireStatusEvent
in classALspLayer
- Parameters:
aStatusEvent
- the status event
-
registerView
Description copied from interface:ILspLayer
Registers a view with this layer. This method is called by the view when this layer is added to it. When the layer is removed from the view, the view invokesILspLayer.unregisterView(com.luciad.view.lightspeed.ILspView)
. This allows the layer to know at all times in which views it is currently present; this information may help it to manage any data that it caches.- Specified by:
registerView
in interfaceILspLayer
- Overrides:
registerView
in classALspLayer
- Parameters:
aView
- the view to which this layer has been added
-
configureForSLDStyling
Style this layer using the specified SLD style. This method is a utility method, which is the equivalent of:
- Setting a
TLspSLDStyler
for the specified SLD style as body styler.
Note that in future versions of the product it is possible that this method will overwrite more settings.
- Parameters:
aSLDFeatureTypeStyle
- The SLD style- Since:
- 2017.0
- See Also:
- Setting a
-
toString
-