Class ConcatenatedGridCoverage


final class ConcatenatedGridCoverage extends GridCoverage
A grid coverage where a single dimension is the concatenation of many grid coverages. All components must have the same "grid to CRS" transform, except for a translation term.
Since:
1.3
Version:
1.3
  • Field Details

    • locator

      private final GridSliceLocator locator
      The object for identifying indices in the slices array.
    • startAt

      private final int startAt
      Index of the first slice in locator.
    • loader

      private final ConcatenatedGridCoverage.Loader loader
      The object in charge of loading and caching grid coverages, or null if none. The same loader may be shared by many ConcatenatedGridCoverage instances.
    • slices

      private final Object[] slices
      The slices of this coverage, in the same order than GridSliceLocator.sliceLows. Array elements shall be instances of GridCoverage or GridCoverageResource. Each slice is not necessarily 1 cell tick; larger slices are accepted. The length of this array shall be at least 2. Shall be read-only.
    • isConverted

      private final boolean isConverted
      Whether this grid coverage should be considered as converted. This is used only if the slices are lazily loaded.
    • strategy

      private final MergeStrategy strategy
      Algorithm to apply when more than one grid coverage can be found at the same grid index. This is null if no merge should be attempted.
  • Constructor Details

    • ConcatenatedGridCoverage

      ConcatenatedGridCoverage(ConcatenatedGridResource source, GridGeometry domain, Object[] slices, int startAt, int[] deferred, GridGeometry request, int[] ranges)
      Creates a new aggregated coverage.
      Parameters:
      source - the concatenated resource which is creating this coverage.
      domain - domain of the coverage to create.
      slices - each slice as instances of GridCoverage or GridCoverageResource.
      startAt - index of the first slice in locator.
      deferred - whether loading of grid coverages should be deferred to rendering time, or null if none.
      request - grid geometry to request when loading data. Used only if slices are lazily loaded.
      ranges - bands to request when loading coverages. Used only if slices are lazily loaded.
    • ConcatenatedGridCoverage

      private ConcatenatedGridCoverage(ConcatenatedGridCoverage source, Object[] slices, List<SampleDimension> sampleDimensions, boolean converted)
      Creates a new aggregated coverage for the result of a conversion from/to packed values. This constructor assumes that all slices use the same sample dimensions.
  • Method Details

    • isDeferred

      private boolean isDeferred(int i)
      Returns true if the loading of the coverage at the given index is deferred. If true, then slices[i] shall be an instance of GridCoverageResource. If false, then slices[i] shall be an instance of GridCoverage.
    • createConvertedValues

      protected GridCoverage createConvertedValues(boolean converted)
      Returns a grid coverage that contains real values or sample values, depending if converted is true or false respectively. This method delegates to all slices in this concatenated coverage.
      Overrides:
      createConvertedValues in class GridCoverage
      Parameters:
      converted - true for a coverage containing converted values, or false for a coverage containing packed values.
      Returns:
      a coverage containing requested values. May be this but never null.
    • render

      public RenderedImage render(GridExtent extent)
      Returns a two-dimensional slice of grid data as a rendered image. Invoking this method may cause the loading of data from ConcatenatedGridResource. Most recently used slices are cached for future invocations of this method.
      Specified by:
      render in class GridCoverage
      Parameters:
      extent - a subspace of this grid coverage extent where all dimensions except two have a size of 1 cell.
      Returns:
      the grid slice as a rendered image. Image location is relative to sliceExtent.