Class RasterLayer.Builder
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
RasterLayer
Builder
for creating a RasterLayer
for a IRasterModel
.
- Styling color data
The raster values are only painted if the pixel density of the raster is not too high. Otherwise the bounds of the raster is painted instead. The style for painting the bounds of the raster data can be customized. You can find an example within this related article on basic raster styling.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns a new layer, based on the properties set on this builder.void
close()
detailFactor
(double factor) Sets the detail factor to use.Sets the fill style used when the raster data extent is shown when zoomed out far.protected void
finalize()
layerType
(RasterLayerType layerType) Sets this raster layer type.lineStyle
(ComplexStrokeLineStyle lineStyle) Sets the line style used when the raster data extent is shown when zoomed out far.Sets the line style used when the raster data extent is shown when zoomed out far.model
(IRasterModel model) Sets the raster model of the layer.rasterStyle
(RasterStyle rasterStyle) Sets the style for this raster.Sets the title to use for the layer.visible
(boolean visible) Sets whether the layer should be visible initially.
-
Constructor Details
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
build
Returns a new layer, based on the properties set on this builder.- Returns:
- a new layer, based on the properties set on this builder.
- Throws:
IllegalArgumentException
- when the raster tile set structure is not supported.IllegalStateException
- If not all mandatory parameters are set.
-
title
Sets the title to use for the layer.If not set, the title from the
ModelMetadata
is used.- Parameters:
title
- the title for the layer.- Returns:
- this builder.
-
visible
Sets whether the layer should be visible initially.Default is
true
.- Parameters:
visible
- the visibility.- Returns:
- this builder.
-
model
Sets the raster model of the layer.Calling this function is mandatory.
- Parameters:
model
- the raster model of the layer.- Returns:
- this builder.
- Throws:
NullPointerException
- if model isnull
.
-
fillStyle
Sets the fill style used when the raster data extent is shown when zoomed out far.- Parameters:
fillStyle
- a fill style created withFillStyle#newBuilder
.- Returns:
- this builder.
-
lineStyle
Sets the line style used when the raster data extent is shown when zoomed out far.Only one line style can be set, if this function is called when a
ComplexStrokeLineStyle
has already been set, it will be overwritten.- Parameters:
lineStyle
- a line style created withLineStyle#newBuilder
.- Returns:
- this builder.
-
lineStyle
Sets the line style used when the raster data extent is shown when zoomed out far.Only one line style can be set, if this function is called when a
LineStyle
has already been set, it will be overwritten.- Parameters:
lineStyle
- a complex stroke line style created withComplexStrokeLineStyle#newBuilder
.- Returns:
- this builder.
- Since:
- 2023.1
-
rasterStyle
Sets the style for this raster.- Parameters:
rasterStyle
- the raster style to apply.- Returns:
- this builder.
- Since:
- 2023.1
-
layerType
Sets this raster layer type.This parameter is optional. If not set, the default is
RasterLayerType#Background
. Note that setting thelayer type
has no effect on elevation raster layers.- Parameters:
layerType
- the type of this raster layer.- Returns:
- this builder.
- Since:
- 2024.0
- See Also:
-
detailFactor
Sets the detail factor to use.The detail factor modifies the quality/detail of the loaded data.
- Parameters:
factor
- The factor to apply.
A factor 1 means no change (default value).
A factor > 1 means more detail.
A factor < 1 means less detail.- Returns:
- this builder.
- Throws:
IllegalArgumentException
- if the factor is not strictly positive.
-