org.opengis.gc
Interface GC_GridCoverage

All Superinterfaces:
CV_Coverage, java.rmi.Remote
All Known Subinterfaces:
GP_GridAnalysis
All Known Implementing Classes:
GC_GridCoverage_Impl, GP_GridAnalysis_Impl, ImageGridCoverage

public interface GC_GridCoverage
extends CV_Coverage

Represent the basic implementation which provides access to grid coverage data. A GC_GridCoverage implementation may provide the ability to update grid values. A basic read-only implementation would be fairly easy to implement.

Since:
1.00
Version:
1.00

Method Summary
 boolean[] getDataBlockAsBoolean(GC_GridRange gridRange)
          Return a sequence of boolean values for a block.
 byte[] getDataBlockAsByte(GC_GridRange gridRange)
          Return a sequence of byte values for a block.
 int[] getDataBlockAsInteger(GC_GridRange gridRange)
          Return a sequence of int values for a block.
 GC_GridGeometry getGridGeometry()
          Information for the grid coverage geometry.
 GC_GridPacking getGridPacking()
          Information for the packing of grid coverage values.
 int getNumOverviews()
          Number of predetermined overviews for the grid.
 int[] getOptimalDataBlockSizes()
          Optimal size to use for each dimension when accessing grid values.
 GC_GridCoverage getOverview(int overviewIndex)
          Returns a pre-calculated overview for a grid coverage.
 GC_GridGeometry getOverviewGridGeometry(int overviewIndex)
          Return the grid geometry for an overview.
 byte[] getPackedDataBlock(GC_GridRange gridRange)
          Return a block of grid coverage data for all sample dimensions.
 double[] getValueBlockAsDouble(GC_GridRange gridRange)
          Return a sequence of double values for a block.
 boolean isDataEditable()
          Returns true if grid data can be edited.
 void setDataBlockAsBoolean(GC_GridRange gridRange, boolean[] values)
          Set a block of boolean values for all sample dimensions.
 void setDataBlockAsByte(GC_GridRange gridRange, byte[] values)
          Set a block of byte values for all sample dimensions.
 void setDataBlockAsDouble(GC_GridRange gridRange, double[] values)
          Set a block of double values for all sample dimensions.
 void setDataBlockAsInteger(GC_GridRange gridRange, int[] values)
          Set a block of bint values for all sample dimensions.
 void setPackedDataBlock(GC_GridRange gridRange, byte[] values)
          Set a block of grid coverage data for all sample dimensions.
 
Methods inherited from interface org.opengis.cv.CV_Coverage
evaluate, evaluateAsBoolean, evaluateAsByte, evaluateAsDouble, evaluateAsInteger, getCoordinateSystem, getDimensionNames, getEnvelope, getMetadataNames, getMetadataValue, getNumSampleDimensions, getNumSources, getSampleDimension, getSource
 

Method Detail

isDataEditable

public boolean isDataEditable()
                       throws java.rmi.RemoteException
Returns true if grid data can be edited.

Returns:
true if grid data can be edited.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getGridPacking

public GC_GridPacking getGridPacking()
                              throws java.rmi.RemoteException
Information for the packing of grid coverage values.

Returns:
the information for the packing of grid coverage values.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getGridGeometry

public GC_GridGeometry getGridGeometry()
                                throws java.rmi.RemoteException
Information for the grid coverage geometry. Grid geometry includes the valid range of grid coordinates and the georeferencing.

Returns:
the information for the grid coverage geometry.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getNumOverviews

public int getNumOverviews()
                    throws java.rmi.RemoteException
Number of predetermined overviews for the grid.

Returns:
the number of predetermined overviews for the grid.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getOptimalDataBlockSizes

public int[] getOptimalDataBlockSizes()
                               throws java.rmi.RemoteException
Optimal size to use for each dimension when accessing grid values. These values together give the optimal block size to use when retrieving grid coverage values. For example, a client application can achieve better performance for a 2-D grid coverage by reading blocks of 128 by 128 if the grid is tiled into blocks of this size. The sequence is ordered by dimension. If the implementation does not have optimal sizes the sequence will be empty.

Returns:
the optimal size to use for each dimension when accessing grid values.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getOverviewGridGeometry

public GC_GridGeometry getOverviewGridGeometry(int overviewIndex)
                                        throws java.rmi.RemoteException
Return the grid geometry for an overview.

Parameters:
overviewIndex - Overview index for which to retrieve grid geometry. Indices start at 0.
Returns:
the grid geometry for an overview.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getOverview

public GC_GridCoverage getOverview(int overviewIndex)
                            throws java.rmi.RemoteException
Returns a pre-calculated overview for a grid coverage. The overview indices are numbered from 0 to numberOverviews-1. The overviews are ordered from highest (index 0) to lowest (numberOverviews -1) resolution. Overview grid coverages will have overviews which are the overviews for the grid coverage with lower resolution than the overview. For example, a 1 meter grid coverage with 3, 9, and 27 meter overviews will be ordered as follows:
Index resolution
0 3
1 9
2 27


The 3 meter overview will have 2 overviews as follows:
Index resolution
0 9
1 27

Parameters:
overviewIndex - Index of grid coverage overview to retrieve. Indexes start at 0.
Returns:
a pre-calculated overview for a grid coverage.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getDataBlockAsBoolean

public boolean[] getDataBlockAsBoolean(GC_GridRange gridRange)
                                throws java.rmi.RemoteException
Return a sequence of boolean values for a block. A value for each sample dimension will be returned.

Parameters:
gridRange - Grid range for block of data to be accessed.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getDataBlockAsByte

public byte[] getDataBlockAsByte(GC_GridRange gridRange)
                          throws java.rmi.RemoteException
Return a sequence of byte values for a block. A value for each sample dimension will be returned.

Parameters:
gridRange - Grid range for block of data to be accessed.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getDataBlockAsInteger

public int[] getDataBlockAsInteger(GC_GridRange gridRange)
                            throws java.rmi.RemoteException
Return a sequence of int values for a block. A value for each sample dimension will be returned.

Parameters:
gridRange - Grid range for block of data to be accessed.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getValueBlockAsDouble

public double[] getValueBlockAsDouble(GC_GridRange gridRange)
                               throws java.rmi.RemoteException
Return a sequence of double values for a block. A value for each sample dimension will be returned.

Parameters:
gridRange - Grid range for block of data to be accessed.
Throws:
java.rmi.RemoteException - if a remote method call failed.

getPackedDataBlock

public byte[] getPackedDataBlock(GC_GridRange gridRange)
                          throws java.rmi.RemoteException
Return a block of grid coverage data for all sample dimensions. A value for each sample dimension will be returned. This operation provides efficient access of the grid values. The sequencing order of the values in the sequence will follow the rules given by valueInBytePacking and bandPacking defined in GC_GridPacking. The requested grid range must satisfy the following rules for each dimension of the grid coverage:
 Min grid coordinate <= grid range minimum <= grid range maximum <= maximum grid coordinate
 
The sequence of bytes returned will match the data type of the dimension. For example, a grid with one 16 bit unsigned (CV_16BIT_U) sample dimension will return 2 bytes for every cell in the block.

Byte padding Rules for grid values of less than 8 bits
For 2 D grid coverages, padding is to the nearest byte for the following cases:
For PixelInterleaved For grids with multiple sample dimensions, padding occurs between pixels for each change in dimension type.
For LineInterleaved Padding occurs at the end of each row or column (depending on the valueSequence of the grid).
For BandSequencial Padding occurs at the end of every sample dimension.
For grid values smaller than 8 bits, their order within each byte is given by the value defined in valueInBytePacking. For grid values bigger than 8 bits, the order of their bytes is given by the value defined in byteInValuePacking.

Parameters:
gridRange - Grid range for block of data to be accessed.
Returns:
a block of grid coverage data for all sample dimensions.
Throws:
java.rmi.RemoteException - if a remote method call failed.

setDataBlockAsBoolean

public void setDataBlockAsBoolean(GC_GridRange gridRange,
                                  boolean[] values)
                           throws java.rmi.RemoteException
Set a block of boolean values for all sample dimensions. The requested grid range must satisfy the following rules for each dimension of the grid coverage:
 Min grid coordinate <= grid range minimum <= grid range maximum <= maximum grid coordinate
 
The number of values must equal:
 (Max1   Min1 + 1) * (Max2   Min2 + 1)... * (Maxn   Minn + 1) * numberSampleDimensions
 
Where

Parameters:
gridRange - Grid range for block of data to be accessed.
values - Sequence of grid values for the given region.
Throws:
java.rmi.RemoteException - if a remote method call failed.

setDataBlockAsByte

public void setDataBlockAsByte(GC_GridRange gridRange,
                               byte[] values)
                        throws java.rmi.RemoteException
Set a block of byte values for all sample dimensions.

Parameters:
gridRange - Grid range for block of data to be accessed.
values - Sequence of grid values for the given region.
Throws:
java.rmi.RemoteException - if a remote method call failed.

setDataBlockAsInteger

public void setDataBlockAsInteger(GC_GridRange gridRange,
                                  int[] values)
                           throws java.rmi.RemoteException
Set a block of bint values for all sample dimensions.

Parameters:
gridRange - Grid range for block of data to be accessed.
values - Sequence of grid values for the given region.
Throws:
java.rmi.RemoteException - if a remote method call failed.

setDataBlockAsDouble

public void setDataBlockAsDouble(GC_GridRange gridRange,
                                 double[] values)
                          throws java.rmi.RemoteException
Set a block of double values for all sample dimensions.

Parameters:
gridRange - Grid range for block of data to be accessed.
values - Sequence of grid values for the given region.
Throws:
java.rmi.RemoteException - if a remote method call failed.

setPackedDataBlock

public void setPackedDataBlock(GC_GridRange gridRange,
                               byte[] values)
                        throws java.rmi.RemoteException
Set a block of grid coverage data for all sample dimensions. See getDataBlock for details on how to pack the values. The requested grid range must satisfy the following rules for each dimension of the grid coverage:
 Min grid coordinate <= grid range minimum <= grid range maximum <= maximum grid coordinate
 
For byte padding rules see getDataBlock.

Parameters:
gridRange - Grid range for block of data to be accessed.
values - Sequence of grid values for the given region.
Throws:
java.rmi.RemoteException - if a remote method call failed.