public class DefaultGridCoverageResponse extends Object implements GridCoverageResponse
Constructor and Description |
---|
DefaultGridCoverageResponse(GridCoverage gridCoverage,
DateRange temporalExtent,
NumberRange<Double> verticalExtent) |
Modifier and Type | Method and Description |
---|---|
Object |
evaluate(DirectPosition point)
Return the value vector for a given point in the coverage.
|
boolean[] |
evaluate(DirectPosition point,
boolean[] destination)
Return a sequence of boolean values for a given point in the coverage.
|
byte[] |
evaluate(DirectPosition point,
byte[] destination)
Return a sequence of unsigned byte values for a given point in the coverage.
|
Set<Record> |
evaluate(DirectPosition p,
Collection<String> list)
Returns a set of records of feature attribute values for the specified direct position.
|
double[] |
evaluate(DirectPosition point,
double[] destination)
Return a sequence of double values for a given point in the coverage.
|
float[] |
evaluate(DirectPosition point,
float[] destination)
Return a sequence of float values for a given point in the coverage.
|
int[] |
evaluate(DirectPosition point,
int[] destination)
Return a sequence of integer values for a given point in the coverage.
|
CoordinateReferenceSystem |
getCoordinateReferenceSystem()
Returns the coordinate reference system to which the objects in its domain are referenced.
|
Envelope |
getEnvelope()
The bounding box for the coverage domain in coordinate reference system coordinates.
|
GridCoverage2D |
getGridCoverage2D()
Return the underlying GridCoverage2D (responses are always 2D)
|
GridGeometry |
getGridGeometry()
Information for the grid coverage geometry.
|
int |
getNumOverviews()
Number of predetermined overviews for the grid.
|
int |
getNumSampleDimensions()
The number of sample dimensions in the coverage.
|
int[] |
getOptimalDataBlockSizes()
Optimal size to use for each dimension when accessing grid values.
|
GridCoverage |
getOverview(int index)
Returns a pre-calculated overview for a grid coverage.
|
GridGeometry |
getOverviewGridGeometry(int index)
Returns the grid geometry for an overview.
|
RecordType |
getRangeType()
Describes the range of the coverage.
|
RenderableImage |
getRenderableImage(int xAxis,
int yAxis)
Returns 2D view of this coverage as a renderable image.
|
RenderedImage |
getRenderedImage()
Returns grid data as a rendered image.
|
SampleDimension |
getSampleDimension(int index)
Retrieve sample dimension information for the coverage.
|
List<GridCoverage> |
getSources()
Returns the sources data for a grid coverage.
|
DateRange |
getTemporalExtent()
Return the temporal extent of this gridcoverage
|
NumberRange<Double> |
getVerticalExtent()
Return the vertical extent of this gridcoverage
|
boolean |
isDataEditable()
Returns
true if grid data can be edited. |
public DefaultGridCoverageResponse(GridCoverage gridCoverage, DateRange temporalExtent, NumberRange<Double> verticalExtent)
public DateRange getTemporalExtent()
GridCoverageResponse
getTemporalExtent
in interface GridCoverageResponse
public NumberRange<Double> getVerticalExtent()
GridCoverageResponse
getVerticalExtent
in interface GridCoverageResponse
public CoordinateReferenceSystem getCoordinateReferenceSystem()
Coverage
evaluate(...)
methods. This coordinate reference system is usually different than coordinate
system of the grid. It is the target coordinate reference system of the gridToCRS
math transform.
Grid coverage can be accessed (re-projected) with new coordinate reference system with the
GridCoverageProcessor
component. In this case, a new
instance of a grid coverage is created.
getCoordinateReferenceSystem
in interface Coverage
evaluate(...)
methods.public Envelope getEnvelope()
Coverage
If a grid coverage does not have any associated coordinate reference system, the minimum and maximum coordinate points for the envelope will be empty sequences.(Minimum row - 0.5, Minimum column - 0.5) for the minimum coordinates (Maximum row - 0.5, Maximum column - 0.5) for the maximum coordinates
getEnvelope
in interface Coverage
public RecordType getRangeType()
Coverage
RecordType
can be used
recursively to describe more complex structures. The range type for a specific coverage shall
be specified in an application schema.getRangeType
in interface Coverage
public Set<Record> evaluate(DirectPosition p, Collection<String> list) throws PointOutsideCoverageException, CannotEvaluateException
Coverage
list
is a sequence of feature attribute names each of which identifies a
field of the range type. If list
is null, the operation shall return a value for
every field of the range type. Otherwise, it shall return a value for each field included in
list
. If the direct position passed is not in the domain of the coverage, then an
exception is thrown. If the input direct position falls within two or more geometric objects
within the domain, the operation shall return records of feature attribute values computed
according to the common point rule.
NOTE: Normally, the operation will return a single record of feature attribute values.
evaluate
in interface Coverage
p
- The position where to evaluate.list
- The field of interest, or null
for every fields.PointOutsideCoverageException
- if the point is outside the coverage domain.CannotEvaluateException
- If the point can't be evaluated for some other reason.public Object evaluate(DirectPosition point) throws PointOutsideCoverageException, CannotEvaluateException
Coverage
The coordinate reference system of the point is the same as the grid coverage coordinate
reference system (specified by the Coverage.getCoordinateReferenceSystem()
method).
WARNING: This method is inherited from the legacy OGC 01-004 specification and may be deprecated in a future version. We are for more experience and feedbacks on the value of this method.
evaluate
in interface Coverage
point
- Point at which to find the grid values.PointOutsideCoverageException
- if the point is outside the coverage envelope.CannotEvaluateException
- If the point can't be evaluated for some other reason.Raster.getDataElements(int, int, Object)
public boolean[] evaluate(DirectPosition point, boolean[] destination) throws PointOutsideCoverageException, CannotEvaluateException, ArrayIndexOutOfBoundsException
Coverage
The coordinate reference system of the point is the same as the grid coverage coordinate
reference system (specified by the Coverage.getCoordinateReferenceSystem()
method).
evaluate
in interface Coverage
point
- Point at which to find the coverage values.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.PointOutsideCoverageException
- if the point is outside the coverage envelope.CannotEvaluateException
- if the point can't be evaluated for some othe reason.ArrayIndexOutOfBoundsException
- if the destination
array is not null and too
small to hold the output.public byte[] evaluate(DirectPosition point, byte[] destination) throws PointOutsideCoverageException, CannotEvaluateException, ArrayIndexOutOfBoundsException
Coverage
The coordinate reference system of the point is the same as the grid coverage coordinate
reference system (specified by the Coverage.getCoordinateReferenceSystem()
method).
evaluate
in interface Coverage
point
- Point at which to find the coverage values.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.PointOutsideCoverageException
- if the point is outside the coverage envelope.CannotEvaluateException
- if the point can't be evaluated for some othe reason.ArrayIndexOutOfBoundsException
- if the destination
array is not null and too
small to hold the output.public int[] evaluate(DirectPosition point, int[] destination) throws PointOutsideCoverageException, CannotEvaluateException, ArrayIndexOutOfBoundsException
Coverage
The coordinate reference system of the point is the same as the grid coverage coordinate
reference system (specified by the Coverage.getCoordinateReferenceSystem()
method).
evaluate
in interface Coverage
point
- Point at which to find the grid values.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.PointOutsideCoverageException
- if the point is outside the coverage envelope.CannotEvaluateException
- if the point can't be evaluated for some othe reason.ArrayIndexOutOfBoundsException
- if the destination
array is not null and too
small to hold the output.Raster.getPixel(int, int, int[])
public float[] evaluate(DirectPosition point, float[] destination) throws PointOutsideCoverageException, CannotEvaluateException, ArrayIndexOutOfBoundsException
Coverage
The coordinate reference system of the point is the same as the grid coverage coordinate
reference system (specified by the Coverage.getCoordinateReferenceSystem()
method).
evaluate
in interface Coverage
point
- Point at which to find the grid values.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.PointOutsideCoverageException
- if the point is outside the coverage envelope.CannotEvaluateException
- if the point can't be evaluated for some othe reason.ArrayIndexOutOfBoundsException
- if the destination
array is not null and too
small to hold the output.Raster.getPixel(int, int, float[])
public double[] evaluate(DirectPosition point, double[] destination) throws PointOutsideCoverageException, CannotEvaluateException, ArrayIndexOutOfBoundsException
Coverage
The coordinate reference system of the point is the same as the grid coverage coordinate
reference system (specified by the Coverage.getCoordinateReferenceSystem()
method).
evaluate
in interface Coverage
point
- Point at which to find the grid values.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.PointOutsideCoverageException
- if the point is outside the coverage envelope.CannotEvaluateException
- If the point can't be evaluated for some othe reason.ArrayIndexOutOfBoundsException
- if the destination
array is not null and too
small to hold the output.Raster.getPixel(int, int, double[])
public int getNumSampleDimensions()
Coverage
WARNING: This method is inherited from the legacy OGC 01-004 specification and may be deprecated in a future version. We are for more experience and feedbacks on the value of this method.
getNumSampleDimensions
in interface Coverage
public SampleDimension getSampleDimension(int index) throws IndexOutOfBoundsException
Coverage
WARNING: This method is inherited from the legacy OGC 01-004 specification and may be deprecated in a future version. We are for more experience and feedbacks on the value of this method.
getSampleDimension
in interface Coverage
index
- Index for sample dimension to retrieve. Indices are numbered 0 to
(n-1).IndexOutOfBoundsException
- if index
is out of bounds.public RenderableImage getRenderableImage(int xAxis, int yAxis) throws UnsupportedOperationException, IndexOutOfBoundsException
Coverage
GridCoverage
backed by a RenderedImage
, the underlying image can be obtained with:
getRenderableImage(0,1).createDefaultRendering()
getRenderableImage
in interface Coverage
xAxis
- Dimension to use for the x axis.yAxis
- Dimension to use for the y axis.UnsupportedOperationException
- if this optional operation is not supported.IndexOutOfBoundsException
- if xAxis
or yAxis
is out of bounds.public boolean isDataEditable()
GridCoverage
true
if grid data can be edited.isDataEditable
in interface GridCoverage
true
if grid data can be edited.public GridGeometry getGridGeometry()
GridCoverage
getGridGeometry
in interface GridCoverage
public int[] getOptimalDataBlockSizes()
GridCoverage
null
.getOptimalDataBlockSizes
in interface GridCoverage
null
if none.public int getNumOverviews()
GridCoverage
getNumOverviews
in interface GridCoverage
public GridGeometry getOverviewGridGeometry(int index) throws IndexOutOfBoundsException
GridCoverage
getOverviewGridGeometry
in interface GridCoverage
index
- Overview index for which to retrieve grid geometry. Indices start at 0.IndexOutOfBoundsException
- if overviewIndex
is out of bounds.public GridCoverage getOverview(int index) throws IndexOutOfBoundsException
GridCoverage
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
getOverview
in interface GridCoverage
index
- Index of grid coverage overview to retrieve. Indexes start at 0.IndexOutOfBoundsException
- if overviewIndex
is out of bounds.public List<GridCoverage> getSources()
GridCoverage
GridCoverage
was produced from
an underlying dataset (by read(...)
for instance), this
method should returns an empty list.
If the GridCoverage
was produced using {link
org.opengis.coverage.processing.GridCoverageProcessor} then it should return the source grid
coverages of the one used as input to GridCoverageProcessor
. In general this method
is intended to return the original GridCoverage
on which it depends.
This is intended to allow applications to establish what GridCoverage
s will be
affected when others are updated, as well as to trace back to the "raw data".
getSources
in interface Coverage
getSources
in interface GridCoverage
public RenderedImage getRenderedImage()
GridCoverage
getRenderedImage
in interface GridCoverage
public GridCoverage2D getGridCoverage2D()
GridCoverageResponse
getGridCoverage2D
in interface GridCoverageResponse
Copyright © 1996–2019 Geotools. All rights reserved.