Class TLfnRasterCoverageMetadata.Builder

Enclosing class:
TLfnRasterCoverageMetadata

public static class TLfnRasterCoverageMetadata.Builder extends ALfnCoverageMetadata.Builder<TLfnRasterCoverageMetadata.Builder>
Builder for raster coverage metadata. See the super class for more information.
Since:
10.0
See Also:
  • 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 class ALfnCoverageMetadata.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

      Sets the optional multi-valued parameters of the coverage. If not set or if set to null, 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, or null to reset to default
      Returns:
      this builder
      Since:
      2013.0
    • parameters

      Sets the optional multi-valued parameters of the coverage. If not set or if set to null, 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, or null to reset to default
      Returns:
      this builder
      Since:
      2013.0
    • samplingMode

      public TLfnRasterCoverageMetadata.Builder samplingMode(ELcdImageSamplingMode aSamplingMode)
      Sets the sampling mode for this coverage. If not set or if set to null, 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 mode POINT.
      • The default sampling mode is AREA if at least one asset part has sampling mode AREA.
      • 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
    • tileSize

      public TLfnRasterCoverageMetadata.Builder tileSize(int aTileWidth, int aTileHeight)
      A convenience method for setting both the tile width and height.
      Parameters:
      aTileWidth - the width of the tiles in this coverage in pixels
      aTileHeight - the height of the tiles in this coverage in pixels
      Returns:
      this builder
      Since:
      2013.0
    • setTileLayout

      public TLfnRasterCoverageMetadata.Builder setTileLayout(int aTileWidth, int aTileHeight)
      Deprecated.
      use tileSize(int, int) instead
    • tileWidth

      public TLfnRasterCoverageMetadata.Builder tileWidth(int aTileWidth)
      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

      public TLfnRasterCoverageMetadata.Builder setTileWidth(int aTileWidth)
      Deprecated.
      use tileWidth(int) instead
    • tileHeight

      public TLfnRasterCoverageMetadata.Builder tileHeight(int aTileHeight)
      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

      public TLfnRasterCoverageMetadata.Builder setTileHeight(int aTileHeight)
      Deprecated.
      use tileHeight(int) instead
    • levelsToProduce

      public TLfnRasterCoverageMetadata.Builder levelsToProduce(int[] aLevelsToProduce)
      Deprecated.
      fusion ignores this setting. The levels to produce are now always detected automatically based on the overlapping asset's resolutions.
    • produceAllLevels

      public TLfnRasterCoverageMetadata.Builder produceAllLevels(boolean aOn)
      Deprecated.
      fusion ignores this setting. The levels to produce are now always detected automatically based on the overlapping asset's resolutions.
    • produceAllLevels

      public TLfnRasterCoverageMetadata.Builder 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

      public final TLfnRasterCoverageMetadata.Builder preserveAssetOrder(boolean aPreserveAssetOrder)
      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 by ALfnCoverageMetadata.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

      public final TLfnRasterCoverageMetadata.Builder 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 by ALfnCoverageMetadata.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

      public final TLfnRasterCoverageMetadata.Builder optimizeForSquarePixels(boolean aOn)
      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.

      1. While preserving the initial bounding box and tile size, the coverage layout is adjusted.
      2. 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.
      3. 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 of TLcdDimension, 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 of ILcdISO19103Measure are not obfuscated because they are usually used for vertical measure types for the dimension axes.

      Parameters:
      aDimensions - the dimensional filters to set, or null 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. Normally TLfnRasterAssetMetadata's also have variables and variable of the coverage is set automatically when you add an asset to the coverage. All the TLfnRasterAssetMetaData 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

      public TLfnRasterCoverageMetadata.Builder areaOfInterest(ILcdBounds aAreaOfInterest)
      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 to null, 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.
      As a consequence of this method, the default tile size will be adjusted, and possibly also the default bounding box, aiming for square pixels.

      For non-tiled coverages, the type is always null.

      Overrides:
      type in class ALfnCoverageMetadata.Builder<TLfnRasterCoverageMetadata.Builder>
      Parameters:
      aType - a type, or null to indicate the default type
      Returns:
      this builder