org.geotools.coverage.grid
Class GridCoverage2D

java.lang.Object
  extended byjavax.media.jai.PropertySourceImpl
      extended byorg.geotools.coverage.AbstractCoverage
          extended byorg.geotools.coverage.grid.AbstractGridCoverage
              extended byorg.geotools.coverage.grid.GridCoverage2D
All Implemented Interfaces:
org.opengis.coverage.Coverage, org.opengis.coverage.grid.GridCoverage, javax.media.jai.PropertySource, RenderedCoverage, java.io.Serializable
Direct Known Subclasses:
Interpolator2D

public class GridCoverage2D
extends AbstractGridCoverage
implements RenderedCoverage

Basic access to grid data values backed by a two-dimensional rendered image. Each band in an image is represented as a sample dimension.

Grid coverages are usually two-dimensional. However, their envelope may have more than two dimensions. For example, a remote sensing image may be valid only over some time range (the time of satellite pass over the observed area). Envelopes for such grid coverage can have three dimensions: the two usual ones (horizontal extent along x and y), and a third one for start time and end time (time extent along t). However, the grid range for all extra-dimension must have a size not greater than 1. In other words, a can be a slice in a 3 dimensional grid coverage. Each slice can have an arbitrary width and height (like any two-dimensional images), but only 1 voxel depth (a "voxel" is a three-dimensional pixel).

Serialization note:
Because it is serializable, can be included as method argument or as return type in Remote Method Invocation (RMI). However, the pixel data are not sent during serialization. Instead, the image data are transmitted "on-demand" using socket communications. This mechanism is implemented using JAI SerializableRenderedImage class. While serialization (usually on server side) should work on J2SE 1.4 and above, deserialization (usually on client side) of instances requires J2SE 1.5.

Since:
2.1
Version:
$Id: GridCoverage2D.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Nested Class Summary
protected  class GridCoverage2D.Renderable
          A view of a grid coverage as a renderable image.
 
Field Summary
protected  GridGeometry2D gridGeometry
          The grid geometry.
protected  javax.media.jai.PlanarImage image
          The raster data.
 
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
protected GridCoverage2D(java.lang.CharSequence name, GridCoverage2D coverage)
          Construct a new grid coverage with the same parameter than the specified coverage.
protected GridCoverage2D(java.lang.CharSequence name, javax.media.jai.PlanarImage image, GridGeometry2D gridGeometry, GridSampleDimension[] bands, org.opengis.coverage.grid.GridCoverage[] sources, java.util.Map properties)
          Constructs a grid coverage with the specified grid geometry and sample dimensions.
  GridCoverage2D(java.lang.CharSequence name, java.awt.image.RenderedImage image, org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.spatialschema.geometry.Envelope envelope, GridSampleDimension[] bands, org.opengis.coverage.grid.GridCoverage[] sources, java.util.Map properties)
          Deprecated. Use GridCoverageFactory instead.
  GridCoverage2D(java.lang.CharSequence name, java.awt.image.RenderedImage image, org.opengis.referencing.crs.CoordinateReferenceSystem crs, org.opengis.referencing.operation.MathTransform gridToCRS, GridSampleDimension[] bands, org.opengis.coverage.grid.GridCoverage[] sources, java.util.Map properties)
          Deprecated. Use GridCoverageFactory instead.
 
Method Summary
protected  GridCoverage2D createGeophysics(boolean geo)
          Invoked by geophysics(boolean) when the packed or geophysics companion of this grid coverage need to be created.
 java.lang.Object evaluate(org.opengis.spatialschema.geometry.DirectPosition point)
          Return the value vector for a given point in the coverage.
 byte[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord, byte[] dest)
          Returns a sequence of byte values for a given point in the coverage.
 double[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord, double[] dest)
          Returns a sequence of double values for a given point in the coverage.
 float[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord, float[] dest)
          Returns a sequence of float values for a given point in the coverage.
 int[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord, int[] dest)
          Returns a sequence of integer values for a given point in the coverage.
 double[] evaluate(java.awt.geom.Point2D coord, double[] dest)
          Returns a sequence of double values for a given two-dimensional point in the coverage.
 float[] evaluate(java.awt.geom.Point2D coord, float[] dest)
          Returns a sequence of float values for a given two-dimensional point in the coverage.
 int[] evaluate(java.awt.geom.Point2D coord, int[] dest)
          Returns a sequence of integer values for a given two-dimensional point in the coverage.
 GridCoverage2D geophysics(boolean geo)
          If , returns the geophysics companion of this grid coverage.
 org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem2D()
          Returns the two-dimensional part of this grid coverage CRS.
 java.lang.String getDebugString(org.opengis.spatialschema.geometry.DirectPosition coord)
          Returns a debug string for the specified coordinate.
 org.opengis.spatialschema.geometry.Envelope getEnvelope()
          Returns the bounding box for the coverage domain in coordinate reference system coordinates.
 Envelope2D getEnvelope2D()
          Returns the two-dimensional bounding box for the coverage domain in coordinate reference system coordinates.
 org.opengis.coverage.grid.GridGeometry getGridGeometry()
          Returns information for the grid coverage geometry.
 javax.media.jai.Interpolation getInterpolation()
          Returns the interpolation used for all methods.
 int getNumSampleDimensions()
          Returns the number of bands in the grid coverage.
 int[] getOptimalDataBlockSizes()
          Returns the optimal size to use for each dimension when accessing grid values.
 java.awt.image.renderable.RenderableImage getRenderableImage(int xAxis, int yAxis)
          Returns 2D view of this grid coverage as a renderable image.
 java.awt.image.RenderedImage getRenderedImage()
          Returns grid data as a rendered image.
 org.opengis.coverage.SampleDimension getSampleDimension(int index)
          Retrieve sample dimension information for the coverage.
 GridSampleDimension[] getSampleDimensions()
          Returns all sample dimensions for this grid coverage.
 boolean isDataEditable()
          Returns if grid data can be edited.
 void prefetch(java.awt.geom.Rectangle2D area)
          Hints that the given area may be needed in the near future.
 void show()
          Display this coverage in a windows.
 
Methods inherited from class org.geotools.coverage.grid.AbstractGridCoverage
getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getGridPacking, getNumOverviews, getOverview, getOverviewGridGeometry, getPackedDataBlock, getSources, pointOutsideCoverage, pointOutsideCoverage, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setPackedDataBlock
 
Methods inherited from class org.geotools.coverage.AbstractCoverage
dispose, evaluate, getCoordinateReferenceSystem, getDimension, getDimensionNames, getDimensionNames, getLocale, getMetadataNames, getMetadataValue, getName, show, toString
 
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.grid.GridCoverage
getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getDataBlock, getGridPacking, getNumOverviews, getOverview, getOverviewGridGeometry, getPackedDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setDataBlock, setPackedDataBlock
 
Methods inherited from interface org.opengis.coverage.Coverage
evaluate, getCoordinateReferenceSystem, getDimensionNames, getMetadataNames, getMetadataValue, getSources
 
Methods inherited from interface javax.media.jai.PropertySource
getProperty, getPropertyClass, getPropertyNames, getPropertyNames
 

Field Detail

image

protected final transient javax.media.jai.PlanarImage image
The raster data.


gridGeometry

protected final GridGeometry2D gridGeometry
The grid geometry.

Constructor Detail

GridCoverage2D

protected GridCoverage2D(java.lang.CharSequence name,
                         GridCoverage2D coverage)
Construct a new grid coverage with the same parameter than the specified coverage. This constructor is useful when creating a coverage with identical data, but in which some method has been overriden in order to process data differently (e.g. interpolating them).

Parameters:
name - The name for this coverage, or for the same than .
coverage - The source grid coverage.

GridCoverage2D

public GridCoverage2D(java.lang.CharSequence name,
                      java.awt.image.RenderedImage image,
                      org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                      org.opengis.spatialschema.geometry.Envelope envelope,
                      GridSampleDimension[] bands,
                      org.opengis.coverage.grid.GridCoverage[] sources,
                      java.util.Map properties)
               throws org.opengis.spatialschema.geometry.MismatchedDimensionException,
                      java.lang.IllegalArgumentException
Deprecated. Use GridCoverageFactory instead.

Constructs a grid coverage with the specified envelope and sample dimensions. This convenience constructor assumes that axis order in the supplied image matches exactly axis order in the supplied CRS. In other words, if axis order in the supplied image is (column,row) (which is the case for a majority of images), then the CRS given to this constructor should probably have a (longitude,latitude) or (easting,northing) axis order.

An exception to the above rule applies for CRS using exactly the following axis order: (NORTH|SOUTH, EAST|WEST). Example of such CRS is . This convenience constructor swaps automatically the axis order for such CRS.

The rules applied by this convenience constructor are heuristic. While we try to keep them stable, some adjustments may be applied in future versions. For strict, determinist behavior, use the constructor variant expecting a MathTransform argument instead of an Envelope. The math transform allows full control on axis swapping and inversion.

Parameters:
name - The grid coverage name.
image - The image.
crs - The coordinate reference system. This specifies the CRS used when accessing a grid coverage with the methods. The number of dimensions must matches the number of dimensions of .
envelope - The grid coverage cordinates. This envelope must have at least two dimensions. The two first dimensions describe the image location along x and y axis. The other dimensions are optional and may be used to locate the image on a vertical axis or on the time axis.
bands - Sample dimensions for each image band, or for default sample dimensions. If non-null, then this array's length must matches the number of bands in .
sources - The sources for this grid coverage, or if none.
properties - The set of properties for this coverage, or if there is none. "Properties" in Java Advanced Imaging is what OpenGIS calls "Metadata". Keys are String objects (CaselessStringKey are accepted as well), while values may be any Object.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - If the envelope's dimension is not the same than the coordinate system's dimension.
java.lang.IllegalArgumentException - if the number of bands differs from the number of sample dimensions.

GridCoverage2D

public GridCoverage2D(java.lang.CharSequence name,
                      java.awt.image.RenderedImage image,
                      org.opengis.referencing.crs.CoordinateReferenceSystem crs,
                      org.opengis.referencing.operation.MathTransform gridToCRS,
                      GridSampleDimension[] bands,
                      org.opengis.coverage.grid.GridCoverage[] sources,
                      java.util.Map properties)
               throws org.opengis.spatialschema.geometry.MismatchedDimensionException,
                      java.lang.IllegalArgumentException
Deprecated. Use GridCoverageFactory instead.

Constructs a grid coverage with the specified transform and sample dimension. This is the most general constructor, the one that gives the maximum control on the grid coverage to be created.

Parameters:
name - The grid coverage name.
image - The image.
crs - The coordinate reference system. This specifies the CRS used when accessing a grid coverage with the methods. The number of dimensions must matches the number of target dimensions of .
gridToCRS - The math transform from grid to coordinate reference system.
bands - Sample dimensions for each image band, or for default sample dimensions. If non-null, then this array's length must matches the number of bands in .
sources - The sources for this grid coverage, or if none.
properties - The set of properties for this coverage, or if there is none. "Properties" in Java Advanced Imaging is what OpenGIS calls "Metadata". Keys are String objects (CaselessStringKey are accepted as well), while values may be any Object.
Throws:
org.opengis.spatialschema.geometry.MismatchedDimensionException - If the transform's dimension is not the same than the coordinate system's dimension.
java.lang.IllegalArgumentException - if the number of bands differs from the number of sample dimensions.

GridCoverage2D

protected GridCoverage2D(java.lang.CharSequence name,
                         javax.media.jai.PlanarImage image,
                         GridGeometry2D gridGeometry,
                         GridSampleDimension[] bands,
                         org.opengis.coverage.grid.GridCoverage[] sources,
                         java.util.Map properties)
                  throws java.lang.IllegalArgumentException
Constructs a grid coverage with the specified grid geometry and sample dimensions. The envelope (including the coordinate reference system) is inferred from the grid geometry.

This constructor accepts an optional set of properties. "Properties" in Java Advanced Imaging is what OpenGIS calls "Metadata". Keys are String objects (CaselessStringKey are accepted as well), while values may be any Object.

Parameters:
name - The grid coverage name.
image - The image.
gridGeometry - The grid geometry (must contains an envelope with its coordinate reference system and a "grid to CRS" transform).
bands - Sample dimensions for each image band, or for default sample dimensions. If non-null, then this array's length must matches the number of bands in .
sources - The sources for this grid coverage, or if none.
properties - The set of properties for this coverage, or none.
Throws:
java.lang.IllegalArgumentException - if the number of bands differs from the number of sample dimensions.
Since:
2.2
Method Detail

isDataEditable

public boolean isDataEditable()
Returns if grid data can be edited. The default implementation returns if image is an instance of WritableRenderedImage.

Specified by:
isDataEditable in interface org.opengis.coverage.grid.GridCoverage
Overrides:
isDataEditable in class AbstractGridCoverage

getGridGeometry

public org.opengis.coverage.grid.GridGeometry getGridGeometry()
Returns information for the grid coverage geometry. Grid geometry includes the valid range of grid coordinates and the georeferencing.

Specified by:
getGridGeometry in interface org.opengis.coverage.grid.GridCoverage
To Do:
Use covariant return type once we are allowed to compile for J2SE 1.5.

getEnvelope

public org.opengis.spatialschema.geometry.Envelope getEnvelope()
Returns the bounding box for the coverage domain in coordinate reference system coordinates. The returned envelope have at least two dimensions. It may have more dimensions if the coverage has some extent in other dimensions (for example a depth, or a start and end time).

Specified by:
getEnvelope in interface org.opengis.coverage.Coverage
Overrides:
getEnvelope in class AbstractCoverage
Returns:
The bounding box for the coverage domain in coordinate system coordinates.

getEnvelope2D

public Envelope2D getEnvelope2D()
Returns the two-dimensional bounding box for the coverage domain in coordinate reference system coordinates. If the coverage envelope has more than two dimensions, only the dimensions used in the underlying rendered image are returned.


getCoordinateReferenceSystem2D

public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem2D()
Returns the two-dimensional part of this grid coverage CRS. This is usually (but not always) identical to the full CRS.

See Also:
AbstractCoverage.getCoordinateReferenceSystem()

getNumSampleDimensions

public int getNumSampleDimensions()
Returns the number of bands in the grid coverage.

Specified by:
getNumSampleDimensions in interface org.opengis.coverage.Coverage

getSampleDimension

public org.opengis.coverage.SampleDimension getSampleDimension(int index)
Retrieve sample dimension information for the coverage. For a grid coverage, a sample dimension is a band. The sample dimension information include such things as description, data type of the value (bit, byte, integer...), the no data values, minimum and maximum values and a color table if one is associated with the dimension. A coverage must have at least one sample dimension.

Specified by:
getSampleDimension in interface org.opengis.coverage.Coverage

getSampleDimensions

public GridSampleDimension[] getSampleDimensions()
Returns all sample dimensions for this grid coverage.


getInterpolation

public javax.media.jai.Interpolation getInterpolation()
Returns the interpolation used for all methods. The default implementation returns InterpolationNearest.

Returns:
The interpolation.

evaluate

public java.lang.Object evaluate(org.opengis.spatialschema.geometry.DirectPosition point)
                          throws org.opengis.coverage.CannotEvaluateException
Return the value vector for a given point in the coverage. A value for each sample dimension is included in the vector.

Specified by:
evaluate in interface org.opengis.coverage.Coverage
Throws:
org.opengis.coverage.CannotEvaluateException

evaluate

public byte[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord,
                       byte[] dest)
                throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of byte values for a given point in the coverage.

Specified by:
evaluate in interface org.opengis.coverage.Coverage
Overrides:
evaluate in class AbstractCoverage
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public int[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord,
                      int[] dest)
               throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of integer values for a given point in the coverage.

Specified by:
evaluate in interface org.opengis.coverage.Coverage
Overrides:
evaluate in class AbstractCoverage
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public float[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord,
                        float[] dest)
                 throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of float values for a given point in the coverage.

Specified by:
evaluate in interface org.opengis.coverage.Coverage
Overrides:
evaluate in class AbstractCoverage
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public double[] evaluate(org.opengis.spatialschema.geometry.DirectPosition coord,
                         double[] dest)
                  throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of double values for a given point in the coverage.

Specified by:
evaluate in interface org.opengis.coverage.Coverage
Overrides:
evaluate in class AbstractCoverage
Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public int[] evaluate(java.awt.geom.Point2D coord,
                      int[] dest)
               throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of integer values for a given two-dimensional point in the coverage.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public float[] evaluate(java.awt.geom.Point2D coord,
                        float[] dest)
                 throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of float values for a given two-dimensional point in the coverage.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

evaluate

public double[] evaluate(java.awt.geom.Point2D coord,
                         double[] dest)
                  throws org.opengis.coverage.CannotEvaluateException
Returns a sequence of double values for a given two-dimensional point in the coverage.

Parameters:
coord - The coordinate point where to evaluate.
dest - An array in which to store values, or .
Returns:
An array containing values.
Throws:
org.opengis.coverage.CannotEvaluateException - if the values can't be computed at the specified coordinate. More specifically, PointOutsideCoverageException is thrown if the evaluation failed because the input point has invalid coordinates.

getDebugString

public java.lang.String getDebugString(org.opengis.spatialschema.geometry.DirectPosition coord)
Returns a debug string for the specified coordinate. This method produces a string with pixel coordinates and pixel values for all bands (with geophysics values or category name in parenthesis). Example for a 1-banded image:
(1171,1566)=[196 (29.6 ?C)]

Parameters:
coord - The coordinate point where to evaluate.
Returns:
A string with pixel coordinates and pixel values at the specified location, or if is outside coverage.

getOptimalDataBlockSizes

public int[] getOptimalDataBlockSizes()
Returns the optimal size to use for each dimension when accessing grid values. The default implementation returns the image's tiles size.

Specified by:
getOptimalDataBlockSizes in interface org.opengis.coverage.grid.GridCoverage

getRenderedImage

public java.awt.image.RenderedImage getRenderedImage()
Returns grid data as a rendered image.

Specified by:
getRenderedImage in interface RenderedCoverage

getRenderableImage

public java.awt.image.renderable.RenderableImage getRenderableImage(int xAxis,
                                                                    int yAxis)
Returns 2D view of this grid coverage as a renderable image. This method allows interoperability with Java2D.

Specified by:
getRenderableImage in interface org.opengis.coverage.Coverage
Overrides:
getRenderableImage in class AbstractCoverage
Parameters:
xAxis - Dimension to use for x axis.
yAxis - Dimension to use for y axis.
Returns:
A 2D view of this grid coverage as a renderable image.

show

public void show()
Display this coverage in a windows. This convenience method is used for debugging purpose. The exact appareance of the windows and the tools provided may changes in future versions.

Overrides:
show in class AbstractCoverage

prefetch

public void prefetch(java.awt.geom.Rectangle2D area)
Hints that the given area may be needed in the near future. Some implementations may spawn a thread or threads to compute the tiles while others may ignore the hint.

Parameters:
area - A rectangle indicating which geographic area to prefetch. This area's coordinates must be expressed according the grid coverage's coordinate reference system, as given by AbstractCoverage.getCoordinateReferenceSystem().

geophysics

public GridCoverage2D geophysics(boolean geo)
If , returns the geophysics companion of this grid coverage. In a geophysics grid coverage, all sample values are equals to geophysics ("real world") values without the need for any transformation. In such geophysics coverage, the sample to geophysics transform is the identity transform for all sample dimensions. "No data" values are expressed by NaN numbers.

This method may be understood as applying the JAI's piecewise operation with breakpoints specified by the Category objects in each sample dimension. However, it is more general in that the transformation specified with each breakpoint doesn't need to be linear. On an implementation note, this method will really try to use the first of the following operations which is found applicable: identity, lookup, rescale, piecewise and in last ressort a more general (but slower) sample transcoding algorithm.

objects live by pair: a geophysics one (used for computation) and a non-geophysics one (used for packing data, usually as integers). The argument specifies which object from the pair is wanted, regardless if this method is invoked on the geophysics or non-geophysics instance of the pair. In other words, the result of depends only on the value in the last call ().

Parameters:
geo - to get a grid coverage with sample values equals to geophysics values, or to get the packed version.
Returns:
The grid coverage. Never , but may be .
See Also:
GridSampleDimension.geophysics(boolean), Category.geophysics(boolean), LookupDescriptor, RescaleDescriptor, PiecewiseDescriptor

createGeophysics

protected GridCoverage2D createGeophysics(boolean geo)
Invoked by geophysics(boolean) when the packed or geophysics companion of this grid coverage need to be created. Subclasses may override this method in order to modify the object to be created.

Parameters:
geo - to get a grid coverage with sample values equals to geophysics values, or to get the packed version.
Returns:
The newly created grid coverage.
To Do:
IndexColorModel seems to badly choose its sample model. As of JDK 1.4-rc1, it construct a ComponentSampleModel, which is drawn very slowly to the screen. A much faster sample model is PixelInterleavedSampleModel, which is the sample model used by BufferedImage for TYPE_BYTE_INDEXED. We should check if this is fixed in future J2SE release., The "Piecewise" operation is disabled because javac 1.4.1_01 generate illegal bytecode. This bug is fixed in javac 1.4.2-beta. However, we still have an ArrayIndexOutOfBoundsException in JAI code..., A special case (exactly one linear relationship with one NaN value mapping exactly to the index value 0) was optimized to the "Rescale" operation in previous version. This case is very common, which make this optimization a usefull one. Unfortunatly, it had to be disabled because there is nothing in the "Rescale" preventing some real number (not NaN) to maps to 0 through the normal linear relationship. Note that the optimization worked well in previous version except for the above-cited problem. We can very easily re- enable it later if we know the range of values really stored in the image (as of JAI's "extrema" operation). If would suffice to add a check making sure that the range of transformed values doesn't contains 0.


Copyright © GeoTools. All Rights Reserved.