Class MemoryGridResource

All Implemented Interfaces:
DataSet, GridCoverageResource, Resource

public class MemoryGridResource extends AbstractGridCoverageResource
A GridCoverageResource in memory. This resource wraps an arbitrary GridCoverage specified at construction time. Metadata can be specified by overriding
invalid reference
#createMetadata(MetadataBuilder)
.
Since:
1.1
Version:
1.3
  • Field Details

    • coverage

      public final GridCoverage coverage
      The grid coverage specified at construction time.
  • Constructor Details

    • MemoryGridResource

      public MemoryGridResource(StoreListeners parent, GridCoverage coverage)
      Creates a new coverage stored in memory.
      Parameters:
      parent - listeners of the parent resource, or null if none.
      coverage - stored coverage retained as-is (not copied). Cannot be null.
  • Method Details

    • getGridGeometry

      public GridGeometry getGridGeometry()
      Returns information about the domain of wrapped grid coverage.
      Returns:
      extent of grid coordinates together with their mapping to "real world" coordinates.
      See Also:
    • getSampleDimensions

      public List<SampleDimension> getSampleDimensions()
      Returns information about the ranges of wrapped grid coverage.
      Returns:
      ranges of sample values together with their mapping to "real values".
      See Also:
    • read

      public GridCoverage read(GridGeometry domain, int... ranges)
      Returns a subset of the wrapped grid coverage. If a non-null grid geometry is specified, then this method tries to return a grid coverage matching the given grid geometry on a best-effort basis. In current implementation this is either a GridCoverage2D or the original grid coverage.
      Parameters:
      domain - desired grid extent and resolution, or null for the whole domain.
      ranges - 0-based indices of sample dimensions to read, or null or an empty sequence for reading them all.
      Returns:
      the grid coverage for the specified domain and ranges.