|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@UML(identifier="CV_GridCoverage", specification=OGC_01004) public interface GridCoverage
Represent the basic implementation which provides access to grid coverage data.
A GridCoverage
implementation may provide the ability to update
grid values.
WARNING: THIS CLASS WILL CHANGE. Current API is derived from OGC Grid Coverages Implementation specification 1.0. We plan to replace it by new interfaces derived from ISO 19123 (Schema for coverage geometry and functions). Current interfaces should be considered as legacy and are included in this distribution only because they were part of GeoAPI 1.0 release. We will try to preserve as much compatibility as possible, but no migration plan has been determined yet. |
RenderedImage
,
PixelAccessor
Method Summary | |
---|---|
boolean[] |
getDataBlock(GridRange gridRange,
boolean[] destination)
Return a sequence of boolean values for a block. |
byte[] |
getDataBlock(GridRange gridRange,
byte[] destination)
Return a sequence of 8 bits values for a block. |
double[] |
getDataBlock(GridRange gridRange,
double[] destination)
Return a sequence of double values for a block. |
float[] |
getDataBlock(GridRange gridRange,
float[] destination)
Return a sequence of float values for a block. |
int[] |
getDataBlock(GridRange gridRange,
int[] destination)
Return a sequence of 32 bits values for a block. |
short[] |
getDataBlock(GridRange gridRange,
short[] destination)
Return a sequence of 16 bits values for a block. |
GridGeometry |
getGridGeometry()
Information for the grid coverage geometry. |
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. |
GridCoverage |
getOverview(int overviewIndex)
Returns a pre-calculated overview for a grid coverage. |
GridGeometry |
getOverviewGridGeometry(int overviewIndex)
Returns the grid geometry for an overview. |
byte[] |
getPackedDataBlock(GridRange gridRange)
Return a block of grid coverage data for all sample dimensions. |
boolean |
isDataEditable()
Returns true if grid data can be edited. |
void |
setDataBlock(GridRange gridRange,
boolean[] values)
Set a block of boolean values for all sample dimensions. |
void |
setDataBlock(GridRange gridRange,
byte[] values)
Set a block of 8 bits values for all sample dimensions. |
void |
setDataBlock(GridRange gridRange,
double[] values)
Set a block of double values for all sample dimensions. |
void |
setDataBlock(GridRange gridRange,
float[] values)
Set a block of float values for all sample dimensions. |
void |
setDataBlock(GridRange gridRange,
int[] values)
Set a block of 32 bits values for all sample dimensions. |
void |
setDataBlock(GridRange gridRange,
short[] values)
Set a block of 16 bits values for all sample dimensions. |
void |
setPackedDataBlock(GridRange gridRange,
byte[] values)
Deprecated. This operation can hardly be implemented efficiently in Java with a byte[] argument type, since we can't easily cast an array
of byte[] to an array of arbitrary type. |
Methods inherited from interface Coverage |
---|
evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluate, evaluateInverse, find, find, getCommonPointRule, getCoordinateReferenceSystem, getDimensionNames, getDomainElements, getDomainExtents, getEnvelope, getMetadataNames, getMetadataValue, getNumSampleDimensions, getRangeElements, getRangeType, getRenderableImage, getSampleDimension, getSources, list, select |
Method Detail |
---|
@UML(identifier="dataEditable", obligation=MANDATORY, specification=OGC_01004) boolean isDataEditable()
true
if grid data can be edited.
true
if grid data can be edited.@UML(identifier="gridPacking", obligation=MANDATORY, specification=OGC_01004) GridPacking getGridPacking()
@UML(identifier="gridGeometry", obligation=MANDATORY, specification=OGC_01004) GridGeometry getGridGeometry()
@UML(identifier="optimalDataBlockSizes", obligation=OPTIONAL, specification=OGC_01004) int[] getOptimalDataBlockSizes()
null
.
null
if none.@UML(identifier="numOverviews", obligation=MANDATORY, specification=OGC_01004) int getNumOverviews()
@UML(identifier="getOverviewGridGeometry", obligation=MANDATORY, specification=OGC_01004) GridGeometry getOverviewGridGeometry(int overviewIndex) throws IndexOutOfBoundsException
overviewIndex
- Overview index for which to retrieve grid geometry. Indices start at 0.
IndexOutOfBoundsException
- if overviewIndex
is out of bounds.@UML(identifier="getOverview", obligation=MANDATORY, specification=OGC_01004) GridCoverage getOverview(int overviewIndex) throws IndexOutOfBoundsException
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 in the left side below. The 3 meter overview will have
2 overviews as in the right side below:
1 meter GC 3 meter overview
Index resolution 0 3 1 9 2 27
Index resolution 0 9 1 27
overviewIndex
- Index of grid coverage overview to retrieve. Indexes start at 0.
IndexOutOfBoundsException
- if overviewIndex
is out of bounds.@UML(identifier="getDataBlockAsBoolean", obligation=MANDATORY, specification=OGC_01004) boolean[] getDataBlock(GridRange gridRange, boolean[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException
getDataBlock(GridRange, double[])
except for the return type.
gridRange
- Grid range for block of data to be accessed.destination
- An optionally preallocated array in which to store the values,
or null
if none.
destination
was non-null, then it is returned.
Otherwise, a new array is allocated and returned.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
ArrayIndexOutOfBoundsException
- if the destination
array is not null
and too small to hold the output.setDataBlock(GridRange, boolean[])
@UML(identifier="getDataBlockAsByte", obligation=MANDATORY, specification=OGC_01004) byte[] getDataBlock(GridRange gridRange, byte[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException
getDataBlock(GridRange, double[])
except for the return type.
gridRange
- Grid range for block of data to be accessed.destination
- An optionally preallocated array in which to store the values,
or null
if none.
destination
was non-null, then it is returned.
Otherwise, a new array is allocated and returned.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
ArrayIndexOutOfBoundsException
- if the destination
array is not null
and too small to hold the output.setDataBlock(GridRange, byte[])
,
UnpackedImageData
@UML(identifier="getDataBlockAsInteger", obligation=MANDATORY, specification=OGC_01004) short[] getDataBlock(GridRange gridRange, short[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException
getDataBlock(GridRange, double[])
except for the return type.
gridRange
- Grid range for block of data to be accessed.destination
- An optionally preallocated array in which to store the values,
or null
if none.
destination
was non-null, then it is returned.
Otherwise, a new array is allocated and returned.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
ArrayIndexOutOfBoundsException
- if the destination
array is not null
and too small to hold the output.setDataBlock(GridRange, int[])
,
UnpackedImageData
@UML(identifier="getDataBlockAsInteger", obligation=MANDATORY, specification=OGC_01004) int[] getDataBlock(GridRange gridRange, int[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException
getDataBlock(GridRange, double[])
except for the return type.
gridRange
- Grid range for block of data to be accessed.destination
- An optionally preallocated array in which to store the values,
or null
if none.
destination
was non-null, then it is returned.
Otherwise, a new array is allocated and returned.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
ArrayIndexOutOfBoundsException
- if the destination
array is not null
and too small to hold the output.setDataBlock(GridRange, int[])
,
Raster.getPixels(int,int,int,int,int[])
,
UnpackedImageData
float[] getDataBlock(GridRange gridRange, float[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException
getDataBlock(GridRange, double[])
except for the return type.
gridRange
- Grid range for block of data to be accessed.destination
- An optionally preallocated array in which to store the values,
or null
if none.
destination
was non-null, then it is returned.
Otherwise, a new array is allocated and returned.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
ArrayIndexOutOfBoundsException
- if the destination
array is not null
and too small to hold the output.setDataBlock(GridRange, float[])
,
Raster.getPixels(int,int,int,int,float[])
,
UnpackedImageData
@UML(identifier="getValueBlockAsDouble", obligation=MANDATORY, specification=OGC_01004) double[] getDataBlock(GridRange gridRange, double[] destination) throws InvalidRangeException, ArrayIndexOutOfBoundsException
gridRange
minimum coordinates to get equivalent grid coordinates.
The requested grid range must satisfy the following rules for each dimension of the grid coverage:
numSampleDimensions
gridRange
- Grid range for block of data to be accessed.destination
- An optionally preallocated array in which to store the values,
or null
if none.
destination
was non-null, then it is returned.
Otherwise, a new array is allocated and returned.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
ArrayIndexOutOfBoundsException
- if the destination
array is not null
and too small to hold the output.setDataBlock(GridRange, double[])
,
Raster.getPixels(int,int,int,int,double[])
,
UnpackedImageData
@UML(identifier="getPackedDataBlock", obligation=MANDATORY, specification=OGC_01004) byte[] getPackedDataBlock(GridRange gridRange) throws InvalidRangeException
valueInBytePacking
and bandPacking
defined in GridPacking
.
The requested grid range must satisfy the following rules for each dimension
of the grid coverage:
UNSIGNED_16BITS
)
sample dimension will return 2 bytes for every cell in the block.
Byte padding rules for grid values of less than 8 bits
For 2D 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. |
valueInBytePacking
.
For grid values bigger than 8 bits, the order of their bytes is given by the
value defined in byteInValuePacking
.
gridRange
- Grid range for block of data to be accessed.
InvalidRangeException
- if gridRange
is out of this grid range bounds.byte[]
return type, since there is no way to cast an array of arbitrary type to an array
of type byte[]
. Even the java.nio.Buffer
doesnt allow
that (it allows the opposite way however).@UML(identifier="setDataBlockAsBoolean", obligation=MANDATORY, specification=OGC_01004) void setDataBlock(GridRange gridRange, boolean[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
setDataBlock(GridRange, double[])
.
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.isDataEditable()
,
getDataBlock(GridRange, boolean[])
@UML(identifier="setDataBlockAsByte", obligation=MANDATORY, specification=OGC_01004) void setDataBlock(GridRange gridRange, byte[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
setDataBlock(GridRange, double[])
.
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.isDataEditable()
,
getDataBlock(GridRange, byte[])
@UML(identifier="setDataBlockAsByte", obligation=MANDATORY, specification=OGC_01004) void setDataBlock(GridRange gridRange, short[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
setDataBlock(GridRange, double[])
.
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.isDataEditable()
,
getDataBlock(GridRange, short[])
@UML(identifier="setDataBlockAsInteger", obligation=MANDATORY, specification=OGC_01004) void setDataBlock(GridRange gridRange, int[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
setDataBlock(GridRange, double[])
.
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.isDataEditable()
,
getDataBlock(GridRange, int[])
,
WritableRaster.setPixels(int,int,int,int,int[])
@UML(identifier="setDataBlockAsInteger", obligation=MANDATORY, specification=OGC_01004) void setDataBlock(GridRange gridRange, float[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
setDataBlock(GridRange, double[])
.
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.isDataEditable()
,
getDataBlock(GridRange, float[])
,
WritableRaster.setPixels(int,int,int,int,float[])
@UML(identifier="setDataBlockAsDouble", obligation=MANDATORY, specification=OGC_01004) void setDataBlock(GridRange gridRange, double[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
numSampleDimensions
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.isDataEditable()
,
getDataBlock(GridRange, double[])
,
WritableRaster.setPixels(int,int,int,int,double[])
@UML(identifier="setPackedDataBlock", obligation=MANDATORY, specification=OGC_01004) void setPackedDataBlock(GridRange gridRange, byte[] values) throws InvalidRangeException, GridNotEditableException, ArrayIndexOutOfBoundsException
byte[]
argument type, since we can't easily cast an array
of byte[]
to an array of arbitrary type.
getPackedDataBlock(org.opengis.coverage.grid.GridRange)
for details on how to pack the values.
gridRange
- Grid range for block of data to be accessed.values
- Sequence of grid values for the given region.
InvalidRangeException
- if gridRange
is out of this grid range bounds.
GridNotEditableException
- if the grid coverage is not editable.
ArrayIndexOutOfBoundsException
- if the values
array is too small.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |