Package org.geotools.coverage.grid
Class AbstractGridCoverage
Object
PropertySourceImpl
AbstractCoverage
AbstractGridCoverage
- All Implemented Interfaces:
Serializable,PropertySource,Coverage,GridCoverage
- Direct Known Subclasses:
GridCoverage2D
Base class for GeoTools implementation of grid coverage.
- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractCoverage
AbstractCoverage.Renderable -
Field Summary
FieldsFields inherited from class AbstractCoverage
crsFields inherited from class PropertySourceImpl
cachedPropertyNames, properties, propertySources -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGridCoverage(CharSequence name, GridCoverage coverage) Constructs a new coverage with the same parameters than the specified coverage.protectedAbstractGridCoverage(CharSequence name, CoordinateReferenceSystem crs, PropertySource propertySource, Map<?, ?> properties) Constructs a grid coverage using the specified coordinate reference system.protectedAbstractGridCoverage(CharSequence name, CoordinateReferenceSystem crs, GridCoverage[] sources, PropertySource propertySource, Map<?, ?> properties) Constructs a grid coverage with sources. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringformatEvaluateError(Point2D point, boolean outside) Constructs an error message for a point that can not be evaluated.protected StringformatEvaluateError(Position point, boolean outside) Constructs an error message for a position that can not be evaluated.intReturns the number of predetermined overviews for the grid.getOverview(int index) Returns a pre-calculated overview for a grid coverage.getOverviewGridGeometry(int index) Returns the grid geometry for an overview.Returns the source data for a grid coverage.booleanReturnstrueif grid data can be edited.Methods inherited from class AbstractCoverage
dispose, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getCoordinateReferenceSystem, getDimension, getEnvelope, getLocale, getName, getRangeType, getRenderableImage, show, show, show, toStringMethods inherited from class PropertySourceImpl
getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNamesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Coverage
evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getCoordinateReferenceSystem, getEnvelope, getNumSampleDimensions, getRangeType, getRenderableImage, getSampleDimensionMethods inherited from interface GridCoverage
getGridGeometry, getOptimalDataBlockSizes, getRenderedImage
-
Field Details
-
LOGGER
The logger for grid coverage operations.
-
-
Constructor Details
-
AbstractGridCoverage
protected AbstractGridCoverage(CharSequence name, CoordinateReferenceSystem crs, PropertySource propertySource, Map<?, ?> properties) Constructs a grid coverage using the specified coordinate reference system. If the coordinate reference system isnull, then the subclasses must overrideAbstractCoverage.getDimension().- Parameters:
name- The grid coverage name.crs- The coordinate reference system. This specifies the coordinate system used when accessing a coverage or grid coverage with theevaluate(...)methods.propertySource- The source for this coverage, ornullif none. Source may be (but is not limited to) aPlanarImageor an otherAbstractGridCoverageobject.properties- The set of properties for this coverage, ornullif there is none. Keys areStringobjects (CaselessStringKeyare accepted as well), while values may be anyObject.
-
AbstractGridCoverage
protected AbstractGridCoverage(CharSequence name, CoordinateReferenceSystem crs, GridCoverage[] sources, PropertySource propertySource, Map<?, ?> properties) Constructs a grid coverage with sources. Arguments are the same than for the previous constructor, with an additionalsourcesargument.- Parameters:
name- The grid coverage name.crs- The coordinate reference system.sources- The sources for a grid coverage, ornullif none.propertySource- The source for properties for this coverage, ornullif none.properties- Set of additional properties for this coverage, ornullif there is none.
-
AbstractGridCoverage
Constructs a new coverage with the same parameters than the specified coverage.- Parameters:
name- The name for this coverage, ornullfor the same thancoverage.coverage- The source coverage.
-
-
Method Details
-
getSources
Returns the source data for a grid coverage. If theGridCoveragewas produced from an underlying dataset, the returned list is an empty list. If theGridCoveragewas produced usingorg.geotools.api.coverage.grid.GridCoverageProcessor, then it should return the source grid coverage of the one used as input toGridCoverageProcessor. In general thegetSources()method is intended to return the originalGridCoverageon which it depends. This is intended to allow applications to establish whatGridCoverages will be affected when others are updated, as well as to trace back to the "raw data".- Specified by:
getSourcesin interfaceCoverage- Specified by:
getSourcesin interfaceGridCoverage- Overrides:
getSourcesin classAbstractCoverage- Returns:
- The list of sources data for a coverage.
-
isDataEditable
public boolean isDataEditable()Returnstrueif grid data can be edited. The default implementation returnsfalse.- Specified by:
isDataEditablein interfaceGridCoverage- Returns:
trueif grid data can be edited.
-
getNumOverviews
public int getNumOverviews()Returns the number of predetermined overviews for the grid. The default implementation returns 0.- Specified by:
getNumOverviewsin interfaceGridCoverage- Returns:
- The number of predetermined overviews for the grid.
-
getOverviewGridGeometry
Returns the grid geometry for an overview. The default implementation always throws an exception, since the default number of overviews is 0.- Specified by:
getOverviewGridGeometryin interfaceGridCoverage- Parameters:
index- Overview index for which to retrieve grid geometry. Indices start at 0.- Returns:
- The grid geometry for an overview.
- Throws:
IndexOutOfBoundsException- if the specified index is out of bounds.
-
getOverview
Returns a pre-calculated overview for a grid coverage. The default implementation always throws an exception, since the default number of overviews is 0.- Specified by:
getOverviewin interfaceGridCoverage- Parameters:
index- Index of grid coverage overview to retrieve. Indexes start at 0.- Returns:
- A pre-calculated overview for a grid coverage.
- Throws:
IndexOutOfBoundsException- if the specified index is out of bounds.
-
formatEvaluateError
Constructs an error message for a point that can not be evaluated. This is used for formatting error messages.- Parameters:
point- The coordinate point to format.outside-trueif the evaluation failed because the given point is outside the coverage, orfalseif it failed for an other (unknown) reason.- Returns:
- An error message.
- Since:
- 2.5
-
formatEvaluateError
Constructs an error message for a position that can not be evaluated. This is used for formatting error messages.- Parameters:
point- The coordinate point to format.outside-trueif the evaluation failed because the given point is outside the coverage, orfalseif it failed for an other (unknown) reason.- Returns:
- An error message.
- Since:
- 2.5
-