Package org.apache.sis.internal.storage
Class MemoryGridResource
java.lang.Object
org.apache.sis.storage.AbstractResource
org.apache.sis.storage.AbstractGridCoverageResource
org.apache.sis.internal.storage.MemoryGridResource
- All Implemented Interfaces:
DataSet
,GridCoverageResource
,Resource
A
GridCoverageResource
in memory.
This resource wraps an arbitrary GridCoverage
specified at construction time.
Metadata can be specified by overriding #createMetadata(MetadataBuilder)
.- Since:
- 1.1
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal GridCoverage
The grid coverage specified at construction time.Fields inherited from class org.apache.sis.storage.AbstractResource
listeners
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryGridResource
(StoreListeners parent, GridCoverage coverage) Creates a new coverage stored in memory. -
Method Summary
Modifier and TypeMethodDescriptionReturns information about the domain of wrapped grid coverage.Returns information about the ranges of wrapped grid coverage.read
(GridGeometry domain, int... ranges) Returns a subset of the wrapped grid coverage.Methods inherited from class org.apache.sis.storage.AbstractGridCoverageResource
canNotRead, createMetadata, getEnvelope, logReadOperation
Methods inherited from class org.apache.sis.storage.AbstractResource
addListener, clearCache, getIdentifier, getMetadata, getSynchronizationLock, removeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sis.storage.GridCoverageResource
getLoadingStrategy, getResolutions, setLoadingStrategy, subset
Methods inherited from interface org.apache.sis.storage.Resource
addListener, getIdentifier, getMetadata, removeListener
-
Field Details
-
coverage
The grid coverage specified at construction time.
-
-
Constructor Details
-
MemoryGridResource
Creates a new coverage stored in memory.- Parameters:
parent
- listeners of the parent resource, ornull
if none.coverage
- stored coverage retained as-is (not copied). Cannot be null.
-
-
Method Details
-
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
Returns information about the ranges of wrapped grid coverage.- Returns:
- ranges of sample values together with their mapping to "real values".
- See Also:
-
read
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 aGridCoverage2D
or the original grid coverage.- Parameters:
domain
- desired grid extent and resolution, ornull
for the whole domain.ranges
- 0-based indices of sample dimensions to read, ornull
or an empty sequence for reading them all.- Returns:
- the grid coverage for the specified domain and ranges.
-