Class SparseTiffCoverage
- All Implemented Interfaces:
Serializable,javax.media.jai.PropertySource,org.geotools.api.coverage.Coverage,org.geotools.api.coverage.grid.GridCoverage
Extends GridCoverage2D to make use of SparseTIFFImageReader.isEmptyTile(int, int). Using this method
allows us to avoid bringing empty tiles in to JAI's tile cache, which uses RAM and processing time. Instead we can
short circuit the usual pixel lookup and return NO_DATA when an empty tile is queried.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.geotools.coverage.grid.GridCoverage2D
org.geotools.coverage.grid.GridCoverage2D.Renderable -
Field Summary
Fields inherited from class org.geotools.coverage.grid.GridCoverage2D
gridGeometry, imageFields inherited from class org.geotools.coverage.grid.AbstractGridCoverage
LOGGERFields inherited from class org.geotools.coverage.AbstractCoverage
crsFields inherited from class javax.media.jai.PropertySourceImpl
cachedPropertyNames, properties, propertySources -
Constructor Summary
ConstructorsConstructorDescriptionSparseTiffCoverage(CharSequence name, org.geotools.coverage.grid.GridCoverage2D coverage) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.geotools.api.coverage.grid.GridCoveragecreateIfSupported(org.geotools.api.coverage.grid.GridCoverage coverage, File file) double[]evaluate(org.geotools.api.geometry.Position coord, double[] dest) Overrides the evaluate method we use fromGridCoverage2Dto do the isEmptyTile short circuit.double[]evaluate(org.geotools.coverage.grid.GridCoordinates2D coord, double[] dest) Overrides the evaluate method for GridCoordinates2D to do the isEmptyTile short circuit.double[]Methods inherited from class org.geotools.coverage.grid.GridCoverage2D
dispose, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, getCoordinateReferenceSystem2D, getDebugString, getEnvelope, getEnvelope2D, getGridGeometry, getInterpolation, getNumSampleDimensions, getOptimalDataBlockSizes, getRenderableImage, getRenderedImage, getSampleDimension, getSampleDimensions, isDataEditable, prefetch, show, show, toStringMethods inherited from class org.geotools.coverage.grid.AbstractGridCoverage
formatEvaluateError, formatEvaluateError, getNumOverviews, getOverview, getOverviewGridGeometry, getSourcesMethods inherited from class org.geotools.coverage.AbstractCoverage
evaluate, evaluate, getCoordinateReferenceSystem, getDimension, getLocale, getName, getRangeType, showMethods inherited from class javax.media.jai.PropertySourceImpl
getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNamesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.geotools.api.coverage.Coverage
evaluate, evaluate, getCoordinateReferenceSystem, getRangeType
-
Constructor Details
-
SparseTiffCoverage
-
-
Method Details
-
createIfSupported
public static org.geotools.api.coverage.grid.GridCoverage createIfSupported(org.geotools.api.coverage.grid.GridCoverage coverage, File file) -
evaluate
public double[] evaluate(org.geotools.api.geometry.Position coord, double[] dest) Overrides the evaluate method we use from
GridCoverage2Dto do the isEmptyTile short circuit.Important - this method returns noData instead of throwing a
PointOutsideCoverageExceptionif the point is out of bounds. Throwing an exception is expensive and we always swallow these exceptions and turn them in to no-data anyway.- Specified by:
evaluatein interfaceorg.geotools.api.coverage.Coverage- Overrides:
evaluatein classorg.geotools.coverage.grid.GridCoverage2D
-
evaluate
public double[] evaluate(org.geotools.coverage.grid.GridCoordinates2D coord, double[] dest) Overrides the evaluate method for GridCoordinates2D to do the isEmptyTile short circuit. This method is used by GridTypedCoverage and SparseTIFFImageReader.
Important - this method returns noData instead of throwing a
PointOutsideCoverageExceptionif the point is out of bounds. Throwing an exception is expensive and we always swallow these exceptions and turn them in to no-data anyway.- Overrides:
evaluatein classorg.geotools.coverage.grid.GridCoverage2D
-
getNoData
public double[] getNoData()
-