Class TLfnRasterCoverageMetadata.Builder
- Enclosing class:
TLfnRasterCoverageMetadata
- Since:
- 10.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionareaOfInterest
(ILcdBounds aAreaOfInterest) Sets the area of interest for this raster coverage.bandSemantics
(Collection<? extends ALcdBandSemantics> aBandSemantics) Sets the band semantics of the coverageExplicitly sets the variable which stores the band semantics information.build()
Builds an immutable raster coverage metadata.dimensions
(Collection<? extends ILcdDimension<?>> aDimensions) Sets the dimensional filters, used for filtering multi-dimensional data such as NetCDF weather data.int[]
Deprecated.fusion ignores this setting.int
Gets this builder's current tile height.int
Gets this builder's current tile width.boolean
Tells if this builder may optimize the coverage layout, tile size and bounding box to enforce square pixels.boolean
Indicates in what order the assets will be fused.levelsToProduce
(int[] aLevelsToProduce) Deprecated.fusion ignores this setting.optimizeForSquarePixels
(boolean aOn) Optimizes the coverage layout upon build, tile size and bounding box to arrive at square pixels.parameters
(TLcdEarthMultivaluedDataParameter... aParameters) Sets the optional multi-valued parameters of the coverage.parameters
(Collection<? extends TLcdEarthMultivaluedDataParameter> aParameters) Sets the optional multi-valued parameters of the coverage.Overrides the default asset order the fusion process will use.preserveAssetOrder
(boolean aPreserveAssetOrder) Overrides the default asset order the fusion process will use.Deprecated.fusion ignores this setting.produceAllLevels
(boolean aOn) Deprecated.fusion ignores this setting.samplingMode
(ELcdImageSamplingMode aSamplingMode) Sets the sampling mode for this coverage.setTileHeight
(int aTileHeight) Deprecated.usetileHeight(int)
insteadsetTileLayout
(int aTileWidth, int aTileHeight) Deprecated.usetileSize(int, int)
insteadsetTileWidth
(int aTileWidth) Deprecated.usetileWidth(int)
insteadtileHeight
(int aTileHeight) Sets the required height of the tiles in this coverage, which must be a non-zero value.tileSize
(int aTileWidth, int aTileHeight) A convenience method for setting both the tile width and height.tileWidth
(int aTileWidth) Sets the required width of the tiles in this coverage, which must be a non-zero value.type
(ELfnDataType aType) Sets the required type of the coverage.Methods inherited from class com.luciad.fusion.tilestore.metadata.ALfnCoverageMetadata.Builder
addAssetInfo, addAssetInfo, assetInfos, assetInfos, assetSourcesInTileStore, boundingBox, dataDensity, featureTypeStyles, featureTypeStyles, format, formatVersion, geoReference, getAssetInfos, getBoundingBox, getDataDensity, getFeatureTypeStyles, getFormat, getFormatVersion, getGeoReference, getLevel0ColumnCount, getLevel0RowCount, getMessageDigestAlgorithm, getScaleDenominators, getType, ignoreNonFatalFailures, ignoreNonFatalFailures, isAssetSourcesInTileStore, isIgnoreNonFatalFailures, layout, level0ColumnCount, level0RowCount, messageDigestAlgorithm, scaleDenominators, scaleDenominators, setAssetInfos, setAssetInfos, setBoundingBox, setCoverageLayout, setDataDensity, setFormat, setFormatVersion, setGeoReference, setLevel0ColumnCount, setLevel0RowCount, setMessageDigestAlgorithm, setScaleDenominators, setScaleDenominators, setType, tileFormat
Methods inherited from class com.luciad.fusion.tilestore.metadata.ALfnResourceMetadata.Builder
abstract_, getAbstract, getGlobalUpdateSequence, getId, getISO19115Metadata, getName, getUpdateSequence, globalUpdateSequence, id, iso19115Metadata, name, setAbstract, setId, setISO19115Metadata, setName, setUpdateSequence, updateSequence
-
Method Details
-
build
Builds an immutable raster coverage metadata. Note that the bounding box will be converted to an equivalent bounding box if the specified bounding box is not compatible with the geographic reference. In practice this means that a conversion will occur if a geodetic reference is used and the specified bounding box type does take this into account.- Specified by:
build
in classALfnCoverageMetadata.Builder<TLfnRasterCoverageMetadata.Builder>
- Returns:
- an immutable raster coverage metadata
- Throws:
NullPointerException
- in case one or more required fields have not been set
-
getTileWidth
public int getTileWidth()Gets this builder's current tile width.- Returns:
- the current tile width
- Since:
- 2012.0
-
getTileHeight
public int getTileHeight()Gets this builder's current tile height.- Returns:
- the current tile height
- Since:
- 2012.0
-
parameters
public TLfnRasterCoverageMetadata.Builder parameters(TLcdEarthMultivaluedDataParameter... aParameters) Sets the optional multi-valued parameters of the coverage. If not set or if set tonull
, the default parameters will be used. The default parameters are the union of the asset's parameters, preserving list order and removing duplicates.Calling this method without parameters will clear them.
- Parameters:
aParameters
- an array of ordered parameters, ornull
to reset to default- Returns:
- this builder
- Since:
- 2013.0
-
parameters
public TLfnRasterCoverageMetadata.Builder parameters(Collection<? extends TLcdEarthMultivaluedDataParameter> aParameters) Sets the optional multi-valued parameters of the coverage. If not set or if set tonull
, the default parameters will be used. The default parameters are the union of the asset's parameters, preserving list order and removing duplicates.Calling this method with empty parameters will clear them.
- Parameters:
aParameters
- an ordered collection of parameters, ornull
to reset to default- Returns:
- this builder
- Since:
- 2013.0
-
samplingMode
Sets the sampling mode for this coverage. If not set or if set tonull
, the default sampling mode will be used. The default sampling mode changes with the asset metadata.- The default sampling mode is
POINT
if and only if all asset parts of all assets have sampling modePOINT
. - The default sampling mode is
AREA
if at least one asset part has sampling modeAREA
. - If there are no asset parts (or no assets), the default sampling mode is
AREA
.
- Parameters:
aSamplingMode
- The sampling mode,null
to use the default sampling mode based on the assets.- Returns:
- this builder
- The default sampling mode is
-
tileSize
A convenience method for setting both the tile width and height.- Parameters:
aTileWidth
- the width of the tiles in this coverage in pixelsaTileHeight
- the height of the tiles in this coverage in pixels- Returns:
- this builder
- Since:
- 2013.0
-
setTileLayout
Deprecated.usetileSize(int, int)
instead -
tileWidth
Sets the required width of the tiles in this coverage, which must be a non-zero value. Is not set or if set to a negative value, a default tile width will be used. The default tile height changes with the layout and bounding box, aiming for a square pixel aspect ratio. A square pixel aspect ratio is required for WMTS compliancy.If set to an illegal value, this method will throw immediately.
- Parameters:
aTileWidth
- The width of the tiles in this coverage in pixels. Use a negative value to reset to default.- Returns:
- this builder
- Since:
- 2013.0
-
setTileWidth
Deprecated.usetileWidth(int)
instead -
tileHeight
Sets the required height of the tiles in this coverage, which must be a non-zero value. Is not set or if set to a negative value, a default tile height will be used. The default tile height changes with the layout and bounding box, aiming for a square pixel aspect ratio. A square pixel aspect ratio is required for WMTS compliancy.If set to the illegal value
0
, this method will throw immediately.- Parameters:
aTileHeight
- The height of the tiles in this coverage in pixels. Use a negative value to reset to default.- Returns:
- this builder
- Since:
- 2013.0
-
setTileHeight
Deprecated.usetileHeight(int)
instead -
levelsToProduce
Deprecated.fusion ignores this setting. The levels to produce are now always detected automatically based on the overlapping asset's resolutions. -
produceAllLevels
Deprecated.fusion ignores this setting. The levels to produce are now always detected automatically based on the overlapping asset's resolutions. -
produceAllLevels
Deprecated.fusion ignores this setting. The levels to produce are now always detected automatically based on the overlapping asset's resolutions. -
getLevelsToProduce
public int[] getLevelsToProduce()Deprecated.fusion ignores this setting. The levels to produce are now always detected automatically based on the overlapping asset's resolutions.- Returns:
- always
null
-
preserveAssetOrder
Overrides the default asset order the fusion process will use.See
TLfnRasterCoverageMetadata.isPreserveAssetOrder()
for more details.By default, this is
false
.- Parameters:
aPreserveAssetOrder
-true
to fuse in order specified byALfnCoverageMetadata.Builder.assetInfos(java.util.List<com.luciad.fusion.tilestore.metadata.ALfnCoverageMetadata.AssetInfo>)
,false
to let the fusion process determine the order automatically.- Returns:
- this builder
- Since:
- 2013.0
-
preserveAssetOrder
Overrides the default asset order the fusion process will use.See
TLfnRasterCoverageMetadata.isPreserveAssetOrder()
for more details.By default, this is
false
.- Returns:
- this builder
- Since:
- 2013.0
-
isPreserveAssetOrder
public boolean isPreserveAssetOrder()Indicates in what order the assets will be fused.See
TLfnRasterCoverageMetadata.isPreserveAssetOrder()
for more details.By default, this is
false
.- Returns:
true
to fuse in order specified byALfnCoverageMetadata.Builder.assetInfos(java.util.List<com.luciad.fusion.tilestore.metadata.ALfnCoverageMetadata.AssetInfo>)
,false
to let the fusion process determine the order automatically.- Since:
- 2013.0
-
optimizeForSquarePixels
Optimizes the coverage layout upon build, tile size and bounding box to arrive at square pixels. An initial bounding box must already have been set, and optionally also the coverage layout and tile size. Square pixels are important when fusing vector data as raster, for example S-57 data. Having square pixels minimizes visual artifacts such as "squashed" icons, which are typically the result of non-square pixel rendering. When the coverage layout has already been set and is already optimal, it will not be overwritten. When multiple coverage layouts are equally optimal, the one which requires the least amount of top-level tiles will be chosen by preference, unless the existing coverage layout is already one of the optimal ones. When the tile size has already been set, the tile size will change whilst trying to match the total number of pixels of the initial tile size as closely as possible. For example, if 100 x 100 is the initial tile size, the initial number of pixels is 10000. Suppose now that the optimal tile aspect is computed to be 2 x 1, then the resulting tile size will be 142 x 71, resulting in 10082 pixels. 10082 is the closest possible match to 10000.- While preserving the initial bounding box and tile size, the coverage layout is adjusted.
- If the above does not suffice, the tile size is further adjusted while preserving the initial bounding box. An attempt is made to stay as close as possible to the initial number of pixels.
- If the above do not suffice, the bounding box is slightly grown either horizontally or vertically.
- Parameters:
aOn
- whether or not to optimize for square pixels- Since:
- 2013.1
-
isOptimizeForSquarePixels
public boolean isOptimizeForSquarePixels()Tells if this builder may optimize the coverage layout, tile size and bounding box to enforce square pixels.- Returns:
- if this builder may optimize the coverage layout, tile size and bounding box to enforce square pixels
- Since:
- 2013.1
- See Also:
-
dimensions
public TLfnRasterCoverageMetadata.Builder dimensions(Collection<? extends ILcdDimension<?>> aDimensions) Sets the dimensional filters, used for filtering multi-dimensional data such as NetCDF weather data. Typical NetCDF dimensions are:- level: height in the atmosphere the sample values were taken
- time: time of day the sample values were taken
When the coverage type is
RASTER
, all possible values for all dimensions will be selected by default, meaning that the coverage will preserve all the multi-dimensional information of the source data. If desired, you can use this method to select a subset.When the coverage type is
IMAGE
, a single value for every dimension will be selected by default. You can change the selection, but only a single possible value per dimension is allowed in this case. Because you're rendering RGB images from multi-dimensional source data, this behaves as a dimensional filter when visualizing the multi-dimensional data. For example, if there are 2 levels {l0, l1} and 2 times {t0, t1} available, the default dimensional filter will filter for the combination (min(t0, t1), min(l0, l1)). The fact that the minimum is the default rather than the first is a consequence of the implementation ofTLcdDimension
, which keeps its intervals sorted. If multiple asset parts contribute to the coverage and they have different dimensions, the first occurrence of a particular dimension will be used.Because the dimensions are marshaled there are two points that you should take into account;
- The given
ILcdDimension
should have a finite set of possible values:ILcdDimension.getValues()
must be finite. This is virtually always the case in practice. - The type that you provide to
TLcdDimensionAxis.Builder.type(Class)
is instantiated afterwards on the runtime with its fully qualified class name. Therefore you should never obfuscate the type if you are using a user defined classes for it. As an example, implementations ofILcdISO19103Measure
are not obfuscated because they are usually used for vertical measure types for the dimension axes.
- Parameters:
aDimensions
- the dimensional filters to set, ornull
to use the default dimensional filters- Returns:
- this builder
- Since:
- 2016.0
-
bandSemantics
public TLfnRasterCoverageMetadata.Builder bandSemantics(Collection<? extends ALcdBandSemantics> aBandSemantics) Sets the band semantics of the coverageExplicitly sets the variable which stores the band semantics information. NormallyTLfnRasterAssetMetadata
's also have variables and variable of the coverage is set automatically when you add an asset to the coverage. All theTLfnRasterAssetMetaData
instances in the raster coverage should have the same variable with the one defined in the coverage.- Parameters:
aBandSemantics
- variable to be set- Returns:
- this builder
- Throws:
IllegalArgumentException
- if there is already a defined variable in the builder and aVariable is not equal to it.- Since:
- 2016.0
-
areaOfInterest
Sets the area of interest for this raster coverage.This does not affect the coverage tile set structure which is determined by the bounding box (
ALfnCoverageMetadata.Builder.boundingBox(ILcdBounds)
). The area of interest is used as information that the data within the coverage has been clipped.- Parameters:
aAreaOfInterest
- the area of interest. It is defined in the geo-reference of the raster coverage.- Returns:
- this builder.
- Since:
- 2018.0.04
-
type
Description copied from class:ALfnCoverageMetadata.Builder
Sets the required type of the coverage. If not set, or if set tonull
, the default type will be used.For vector coverages, the default type is
VECTOR
.For raster coverages, the default type depends on the asset metadatas.
- If no asset metadatas have been set, the default type is
IMAGE
. - If the asset metadatas have a common type, then this will be the default.
- If the asset metadatas have a mixture of types, the default will be
IMAGE
since it is the greatest common denominator.
For non-tiled coverages, the type is always
null
.- Overrides:
type
in classALfnCoverageMetadata.Builder<TLfnRasterCoverageMetadata.Builder>
- Parameters:
aType
- a type, ornull
to indicate the default type- Returns:
- this builder
- If no asset metadatas have been set, the default type is
-