Package repast.simphony.space.gis
Class WritableGridCoverage2D
java.lang.Object
javax.media.jai.PropertySourceImpl
org.geotools.coverage.AbstractCoverage
org.geotools.coverage.grid.AbstractGridCoverage
org.geotools.coverage.grid.GridCoverage2D
repast.simphony.space.gis.WritableGridCoverage2D
- All Implemented Interfaces:
Serializable
,javax.media.jai.PropertySource
,org.opengis.coverage.Coverage
,org.opengis.coverage.grid.GridCoverage
public class WritableGridCoverage2D
extends org.geotools.coverage.grid.GridCoverage2D
WritableGridCoverage2D provides write capabilities to GridCoverage2D by
wrapping a standard GridCoverage2D and overriding the evaluate methods
and providing set methods. All other method calls are handled as usual by
the parent Abstract coverage which is set via super().
Adapted from example code in the GeoTools distribution. Original work
by Michael Bedward.
TODO GIS catch set position or lat/lon out of bounds
TODO GIS allow multi-band storage
- Author:
- Michael Bedward, Eric Tatara
- 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, image
Fields inherited from class org.geotools.coverage.grid.AbstractGridCoverage
LOGGER
Fields inherited from class org.geotools.coverage.AbstractCoverage
crs
Fields inherited from class javax.media.jai.PropertySourceImpl
cachedPropertyNames, properties, propertySources
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
float[]
int[]
double[]
evaluate
(org.geotools.coverage.grid.GridCoordinates2D coord, double[] dest) float[]
evaluate
(org.geotools.coverage.grid.GridCoordinates2D coord, float[] dest) int[]
evaluate
(org.geotools.coverage.grid.GridCoordinates2D coord, int[] dest) evaluate
(org.opengis.geometry.DirectPosition point) byte[]
evaluate
(org.opengis.geometry.DirectPosition coord, byte[] dest) double[]
evaluate
(org.opengis.geometry.DirectPosition coord, double[] dest) float[]
evaluate
(org.opengis.geometry.DirectPosition coord, float[] dest) int[]
evaluate
(org.opengis.geometry.DirectPosition coord, int[] dest) void
flushCache
(boolean force) org.opengis.referencing.crs.CoordinateReferenceSystem
getRenderableImage
(int xAxis, int yAxis) boolean
void
prefetch
(Rectangle2D area) void
setValue
(org.geotools.coverage.grid.GridCoordinates2D gridPos, double value) void
setValue
(org.geotools.coverage.grid.GridCoordinates2D gridPos, float value) void
setValue
(org.geotools.coverage.grid.GridCoordinates2D gridPos, int value) void
setValue
(org.opengis.geometry.DirectPosition worldPos, double value) void
setValue
(org.opengis.geometry.DirectPosition worldPos, float value) void
setValue
(org.opengis.geometry.DirectPosition worldPos, int value) void
void
Methods inherited from class org.geotools.coverage.grid.GridCoverage2D
dispose, getCoordinateReferenceSystem2D, getDebugString, getEnvelope, getEnvelope2D, getGridGeometry, getInterpolation, getNumSampleDimensions, getOptimalDataBlockSizes, getSampleDimension, getSampleDimensions, toString
Methods inherited from class org.geotools.coverage.grid.AbstractGridCoverage
formatEvaluateError, formatEvaluateError, getNumOverviews, getOverview, getOverviewGridGeometry, getSources
Methods inherited from class org.geotools.coverage.AbstractCoverage
evaluate, evaluate, getDimension, getLocale, getName, getRangeType, show
Methods inherited from class javax.media.jai.PropertySourceImpl
getProperties, getProperty, getPropertyClass, getPropertyNames, getPropertyNames
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.coverage.Coverage
evaluate, evaluate, getRangeType
-
Constructor Details
-
WritableGridCoverage2D
public WritableGridCoverage2D(org.geotools.coverage.grid.GridCoverage2D grid)
-
-
Method Details
-
evaluate
public Object evaluate(org.opengis.geometry.DirectPosition point) throws org.opengis.coverage.CannotEvaluateException - Specified by:
evaluate
in interfaceorg.opengis.coverage.Coverage
- Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public byte[] evaluate(org.opengis.geometry.DirectPosition coord, byte[] dest) throws org.opengis.coverage.CannotEvaluateException - Specified by:
evaluate
in interfaceorg.opengis.coverage.Coverage
- Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public int[] evaluate(org.opengis.geometry.DirectPosition coord, int[] dest) throws org.opengis.coverage.CannotEvaluateException - Specified by:
evaluate
in interfaceorg.opengis.coverage.Coverage
- Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public float[] evaluate(org.opengis.geometry.DirectPosition coord, float[] dest) throws org.opengis.coverage.CannotEvaluateException - Specified by:
evaluate
in interfaceorg.opengis.coverage.Coverage
- Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public double[] evaluate(org.opengis.geometry.DirectPosition coord, double[] dest) throws org.opengis.coverage.CannotEvaluateException - Specified by:
evaluate
in interfaceorg.opengis.coverage.Coverage
- Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public int[] evaluate(Point2D coord, int[] dest) throws org.opengis.coverage.CannotEvaluateException - Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public float[] evaluate(Point2D coord, float[] dest) throws org.opengis.coverage.CannotEvaluateException - Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public double[] evaluate(Point2D coord, double[] dest) throws org.opengis.coverage.CannotEvaluateException - Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
- Throws:
org.opengis.coverage.CannotEvaluateException
-
evaluate
public int[] evaluate(org.geotools.coverage.grid.GridCoordinates2D coord, int[] dest) - Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
-
evaluate
public float[] evaluate(org.geotools.coverage.grid.GridCoordinates2D coord, float[] dest) - Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
-
evaluate
public double[] evaluate(org.geotools.coverage.grid.GridCoordinates2D coord, double[] dest) - Overrides:
evaluate
in classorg.geotools.coverage.grid.GridCoverage2D
-
getRenderableImage
- Specified by:
getRenderableImage
in interfaceorg.opengis.coverage.Coverage
- Overrides:
getRenderableImage
in classorg.geotools.coverage.grid.GridCoverage2D
-
getRenderedImage
- Specified by:
getRenderedImage
in interfaceorg.opengis.coverage.grid.GridCoverage
- Overrides:
getRenderedImage
in classorg.geotools.coverage.grid.GridCoverage2D
-
isDataEditable
public boolean isDataEditable()- Specified by:
isDataEditable
in interfaceorg.opengis.coverage.grid.GridCoverage
- Overrides:
isDataEditable
in classorg.geotools.coverage.grid.GridCoverage2D
-
prefetch
- Overrides:
prefetch
in classorg.geotools.coverage.grid.GridCoverage2D
-
show
- Overrides:
show
in classorg.geotools.coverage.grid.GridCoverage2D
-
show
- Overrides:
show
in classorg.geotools.coverage.grid.GridCoverage2D
-
getCoordinateReferenceSystem
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()- Specified by:
getCoordinateReferenceSystem
in interfaceorg.opengis.coverage.Coverage
- Overrides:
getCoordinateReferenceSystem
in classorg.geotools.coverage.AbstractCoverage
-
setValue
public void setValue(org.opengis.geometry.DirectPosition worldPos, int value) -
setValue
public void setValue(org.opengis.geometry.DirectPosition worldPos, float value) -
setValue
public void setValue(org.opengis.geometry.DirectPosition worldPos, double value) -
setValue
public void setValue(org.geotools.coverage.grid.GridCoordinates2D gridPos, int value) -
setValue
public void setValue(org.geotools.coverage.grid.GridCoordinates2D gridPos, float value) -
setValue
public void setValue(org.geotools.coverage.grid.GridCoordinates2D gridPos, double value) -
flushCache
public void flushCache(boolean force)
-