|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectOperations
public class Operations
Convenience, type-safe, methods for applying some common operations on
coverage objects. All methods wrap their arguments in a
parameter value group and delegate the work to the processor's
doOperation
method.
This convenience class do not brings any new functionalities, but brings type-safety when the
operation is know at compile time. For operation unknown at compile time (e.g. for an operation
selected by users in some widget), use the processor directly.
org.geotools.coverage.processing.operation
Field Summary | |
---|---|
static Operations |
DEFAULT
The default instance. |
Constructor Summary | |
---|---|
Operations(RenderingHints hints)
Creates a new instance using the specified hints. |
Method Summary | |
---|---|
Coverage |
absolute(Coverage source)
Computes the mathematical absolute value of each sample value. |
Coverage |
add(Coverage source,
double[] constants)
Adds constants (one for each band) to every sample values of the source coverage. |
Coverage |
crop(Coverage Source,
Envelope envelope)
Crops the image to a specified rectangular area. |
Coverage |
divideBy(Coverage source,
double[] constants)
Divides every sample values of the source coverage by constants (one for each band). |
protected Coverage |
doOperation(String operationName,
Coverage source)
Applies a process operation with default parameters. |
protected Coverage |
doOperation(String operationName,
Coverage source,
String argumentName1,
Object argumentValue1)
Applies a process operation with one parameter. |
protected Coverage |
doOperation(String operationName,
Coverage source,
String argumentName1,
Object argumentValue1,
String argumentName2,
Object argumentValue2)
Applies process operation with two parameters. |
protected Coverage |
doOperation(String operationName,
Coverage source,
String argumentName1,
Object argumentValue1,
String argumentName2,
Object argumentValue2,
String argumentName3,
Object argumentValue3)
Applies a process operation with three parameters. |
protected Coverage |
doOperation(String operationName,
Coverage source,
String argumentName1,
Object argumentValue1,
String argumentName2,
Object argumentValue2,
String argumentName3,
Object argumentValue3,
String argumentName4,
Object argumentValue4)
Applies a process operation with four parameters. |
protected Coverage |
doOperation(String operationName,
Coverage source,
String argumentName1,
Object argumentValue1,
String argumentName2,
Object argumentValue2,
String argumentName3,
Object argumentValue3,
String argumentName4,
Object argumentValue4,
String argumentName5,
Object argumentValue5)
Applies a process operation with five parameters. |
protected Coverage |
doOperation(String operationName,
Coverage source,
String argumentName1,
Object argumentValue1,
String argumentName2,
Object argumentValue2,
String argumentName3,
Object argumentValue3,
String argumentName4,
Object argumentValue4,
String argumentName5,
Object argumentValue5,
String argumentName6,
Object argumentValue6)
Applies a process operation with six parameters. |
Coverage |
exp(Coverage source)
Takes the exponential of the sample values of a coverage. |
GridCoverage |
filteredSubsample(GridCoverage source)
Subsamples an image using the default values. |
GridCoverage |
filteredSubsample(GridCoverage source,
int scaleX,
int scaleY,
float[] qsFilter)
Subsamples an image by integral factors. |
GridCoverage |
filteredSubsample(GridCoverage source,
int scaleX,
int scaleY,
float[] qsFilter,
Interpolation interpolation)
Subsamples an image by integral factors. |
GridCoverage |
filteredSubsample(GridCoverage source,
int scaleX,
int scaleY,
float[] qsFilter,
Interpolation interpolation,
BorderExtender be)
Deprecated. use filteredSubsample(GridCoverage, int, int, float[], Interpolation) |
Coverage |
gradientMagnitude(Coverage source)
Edge detector which computes the magnitude of the image gradient vector in two orthogonal directions. |
Coverage |
gradientMagnitude(Coverage source,
KernelJAI mask1,
KernelJAI mask2)
Edge detector which computes the magnitude of the image gradient vector in two orthogonal directions. |
GridCoverage |
interpolate(GridCoverage source,
Interpolation type)
Specifies the interpolation type to be used to interpolate values for points which fall between grid cells. |
GridCoverage |
interpolate(GridCoverage source,
Interpolation[] types)
Specifies the interpolation types to be used to interpolate values for points which fall between grid cells. |
GridCoverage |
interpolate(GridCoverage source,
String type)
Specifies the interpolation type to be used to interpolate values for points which fall between grid cells. |
Coverage |
invert(Coverage source)
Inverts the sample values of a coverage. |
Coverage |
log(Coverage source)
Takes the natural logarithm of the sample values of a coverage. |
Coverage |
multiply(Coverage source,
double[] constants)
Multiplies every sample values of the source coverage by constants (one for each band). |
GridCoverage |
nodataFilter(GridCoverage source)
Replaces NaN values by the weighted average of neighbors values. |
GridCoverage |
nodataFilter(GridCoverage source,
int padding,
int validityThreshold)
Replaces NaN values by the weighted average of neighbors values. |
GridCoverage |
recolor(GridCoverage source,
ColorMap[] colorMaps)
Recolors a coverage to the specified color maps. |
GridCoverage |
recolor(GridCoverage source,
Map[] colorMaps)
Deprecated. Parameter of type Map is deprecated. Please use the parameter of
type ColorMap instead. |
Coverage |
resample(Coverage source,
CoordinateReferenceSystem crs)
Resamples a coverage to the specified coordinate reference system. |
Coverage |
resample(GridCoverage source,
CoordinateReferenceSystem crs,
GridGeometry gridGeometry,
Interpolation interpolationType)
Resamples a grid coverage to the specified coordinate reference system and grid geometry. |
Coverage |
resample(GridCoverage source,
Envelope envelope,
Interpolation interpolationType)
Resamples a grid coverage to the specified envelope. |
Coverage |
rescale(Coverage source,
double[] constants,
double[] offsets)
Maps the sample values of a coverage from one range to another range. |
GridCoverage |
scale(GridCoverage source,
double xScale,
double yScale,
double xTrans,
double yTrans)
Translates and resizes an image. |
GridCoverage |
scale(GridCoverage source,
double xScale,
double yScale,
double xTrans,
double yTrans,
Interpolation interpolation)
Translates and resizes an image. |
GridCoverage |
scale(GridCoverage source,
double xScale,
double yScale,
double xTrans,
double yTrans,
Interpolation interpolation,
BorderExtender extender)
Deprecated. Replaced by #scale(GridCoverage,double,double,double,double,
Interpolation . |
Coverage |
selectSampleDimension(Coverage source,
int[] sampleDimensions)
Chooses N sample dimensions from a coverage and copies their sample data to the destination grid coverage in the order specified. |
GridCoverage |
subsampleAverage(GridCoverage source,
double scaleX,
double scaleY)
Subsamples an image by averaging over a moving window |
GridCoverage |
subsampleAverage(GridCoverage source,
double scaleX,
double scaleY,
Interpolation interpolation,
BorderExtender be)
Deprecated. use subsampleAverage(GridCoverage, double, double) instead. |
GridCoverage |
SubsampleAverage(GridCoverage source,
double scaleX,
double scaleY,
Interpolation interpolation,
BorderExtender be)
Deprecated. Renamed as subsampleAverage (lower case "s"). |
Coverage |
subtract(Coverage source,
double[] constants)
Subtracts constants (one for each band) from every sample values of the source coverage. |
Coverage |
subtractFrom(Coverage source,
double[] constants)
Subtracts every sample values of the source coverage from constants (one for each band). |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Operations DEFAULT
Constructor Detail |
---|
public Operations(RenderingHints hints)
hints
- The hints, or null
if none.Method Detail |
---|
public Coverage add(Coverage source, double[] constants) throws CoverageProcessingException
source
- The source coverage.constants
- The constants to add to each band.
CoverageProcessingException
- if the operation can't be applied.AddConst
public Coverage subtract(Coverage source, double[] constants) throws CoverageProcessingException
source
- The source coverage.constants
- The constants to subtract to each band.
CoverageProcessingException
- if the operation can't be applied.SubtractConst
public Coverage subtractFrom(Coverage source, double[] constants) throws CoverageProcessingException
source
- The source coverage.constants
- The constants to subtract from.
CoverageProcessingException
- if the operation can't be applied.SubtractFromConst
public Coverage multiply(Coverage source, double[] constants) throws CoverageProcessingException
source
- The source coverage.constants
- The constants to multiply to each band.
CoverageProcessingException
- if the operation can't be applied.MultiplyConst
public Coverage divideBy(Coverage source, double[] constants) throws CoverageProcessingException
source
- The source coverage.constants
- The constants to divides by.
CoverageProcessingException
- if the operation can't be applied.DivideByConst
public Coverage rescale(Coverage source, double[] constants, double[] offsets) throws CoverageProcessingException
source
- The source coverage.constants
- The constants to multiply to each band.offsets
- The constants to add to each band.
CoverageProcessingException
- if the operation can't be applied.Rescale
public Coverage invert(Coverage source) throws CoverageProcessingException
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.Invert
public Coverage absolute(Coverage source) throws CoverageProcessingException
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.Absolute
public Coverage log(Coverage source) throws CoverageProcessingException
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.Log
public Coverage exp(Coverage source) throws CoverageProcessingException
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.Exp
public GridCoverage nodataFilter(GridCoverage source) throws CoverageProcessingException
NaN
values by the weighted average of neighbors values.
This method uses the default padding and validity threshold.
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.NodataFilter
public GridCoverage nodataFilter(GridCoverage source, int padding, int validityThreshold) throws CoverageProcessingException
NaN
values by the weighted average of neighbors values.
source
- The source coverage.padding
- The number of pixels above, below, to the left and to the right of central
NaN
pixel to use for computing the average. The default value is 1.validityThreshold
- The minimal number of valid values required for computing the
average. The NaN
value will be replaced by the average only if the number
of valid value is greater than or equals to this threshold. The default value is 4.
CoverageProcessingException
- if the operation can't be applied.NodataFilter
public GridCoverage interpolate(GridCoverage source, String type) throws CoverageProcessingException
source
- The source coverage.type
- The interpolation type. Possible values are "NearestNeighbor"
,
"Bilinear"
and "Bicubic"
.
CoverageProcessingException
- if the operation can't be applied.Interpolate
public GridCoverage interpolate(GridCoverage source, Interpolation type) throws CoverageProcessingException
source
- The source coverage.type
- The interpolation type as a JAI interpolation object.
CoverageProcessingException
- if the operation can't be applied.Interpolate
public GridCoverage interpolate(GridCoverage source, Interpolation[] types) throws CoverageProcessingException
NaN
value.
See Interpolate
operation for details.
source
- The source coverage.types
- The interpolation types and their fallback.
CoverageProcessingException
- if the operation can't be applied.Interpolate
public GridCoverage recolor(GridCoverage source, Map[] colorMaps) throws CoverageProcessingException
Map
is deprecated. Please use the parameter of
type ColorMap
instead.
source
- The source coverage.colorMaps
- The color maps to apply.
CoverageProcessingException
- if the operation can't be applied.Recolor
public GridCoverage recolor(GridCoverage source, ColorMap[] colorMaps) throws CoverageProcessingException
source
- The source coverage.colorMaps
- The color maps to apply.
CoverageProcessingException
- if the operation can't be applied.Recolor
public Coverage selectSampleDimension(Coverage source, int[] sampleDimensions) throws CoverageProcessingException
source
- The source coverage.sampleDimensions
- The sample dimensions to select.
CoverageProcessingException
- if the operation can't be applied.SelectSampleDimension
public Coverage resample(Coverage source, CoordinateReferenceSystem crs) throws CoverageProcessingException
source
- The source coverage.crs
- The target coordinate reference system.
CoverageProcessingException
- if the operation can't be applied.Resample
public Coverage resample(GridCoverage source, Envelope envelope, Interpolation interpolationType) throws CoverageProcessingException
source
- The source coverage.envelope
- The target envelope, including a possibly different coordinate reference system.interpolationType
- The interpolation type, or null
for the default one.
CoverageProcessingException
- if the operation can't be applied.Resample
,
Resample.computeGridGeometry(org.opengis.coverage.grid.GridCoverage, org.opengis.geometry.Envelope)
public Coverage resample(GridCoverage source, CoordinateReferenceSystem crs, GridGeometry gridGeometry, Interpolation interpolationType) throws CoverageProcessingException
source
- The source coverage.crs
- The target coordinate reference system, or null
for keeping it unchanged.gridGeometry
- The grid geometry, or null
for a default one.interpolationType
- The interpolation type, or null
for the default one.
CoverageProcessingException
- if the operation can't be applied.Resample
public Coverage crop(Coverage Source, Envelope envelope) throws CoverageProcessingException
source
- The source coverage.envelope
- The rectangular area to keep.
CoverageProcessingException
- if the operation can't be applied.Crop
public GridCoverage scale(GridCoverage source, double xScale, double yScale, double xTrans, double yTrans) throws CoverageProcessingException
source
- The source coverage.xScale
- The scale factor along the x axis.yScale
- The scale factor along the y axis.xTrans
- The translation along the x axis.yTrans
- The translation along the x axis.
CoverageProcessingException
- if the operation can't be applied.Scale
public GridCoverage scale(GridCoverage source, double xScale, double yScale, double xTrans, double yTrans, Interpolation interpolation) throws CoverageProcessingException
source
- The source coverage.xScale
- The scale factor along the x axis.yScale
- The scale factor along the y axis.xTrans
- The translation along the x axis.yTrans
- The translation along the x axis.interpolation
- The interpolation to use, or null
for the default.
CoverageProcessingException
- if the operation can't be applied.Scale
public GridCoverage scale(GridCoverage source, double xScale, double yScale, double xTrans, double yTrans, Interpolation interpolation, BorderExtender extender) throws CoverageProcessingException
#scale(GridCoverage,double,double,double,double,
Interpolation
.
source
- The source coverage.xScale
- The scale factor along the x axis.yScale
- The scale factor along the y axis.xTrans
- The translation along the x axis.yTrans
- The translation along the x axis.interpolation
- The interpolation to use, or null
for the default.extender
- The border extender, or null
for the default.
CoverageProcessingException
- if the operation can't be applied.Scale
public GridCoverage SubsampleAverage(GridCoverage source, double scaleX, double scaleY, Interpolation interpolation, BorderExtender be) throws CoverageProcessingException
subsampleAverage
(lower case "s").
CoverageProcessingException
public GridCoverage subsampleAverage(GridCoverage source, double scaleX, double scaleY, Interpolation interpolation, BorderExtender be) throws CoverageProcessingException
subsampleAverage(GridCoverage, double, double)
instead.
source
- The source coverage.scaleX
- The scale factor along the x axis.scaleY
- The scale factor along the y axis.interpolation
- The interpolation to use, or null
for the default.be
- The border extender, or null
for the default.
CoverageProcessingException
- if the operation can't be applied.SubsampleAverage
public GridCoverage subsampleAverage(GridCoverage source, double scaleX, double scaleY) throws CoverageProcessingException
source
- The source coverage.scaleX
- The scale factor along the x axis.scaleY
- The scale factor along the y axis.
CoverageProcessingException
- if the operation can't be applied.SubsampleAverage
public GridCoverage filteredSubsample(GridCoverage source) throws CoverageProcessingException
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.FilteredSubsample
public GridCoverage filteredSubsample(GridCoverage source, int scaleX, int scaleY, float[] qsFilter) throws CoverageProcessingException
source
- The source coverage.scaleX
- The scale factor along the x axis. The default value is 2.scaleY
- The scale factor along the y axis. The default value is 2.qsFilter
- The filter. Default to a quadrant symmetric filter generated from
a Gaussian kernel
CoverageProcessingException
- if the operation can't be applied.FilteredSubsample
public GridCoverage filteredSubsample(GridCoverage source, int scaleX, int scaleY, float[] qsFilter, Interpolation interpolation) throws CoverageProcessingException
source
- The source coverage.scaleX
- The scale factor along the x axis. The default value is 2.scaleY
- The scale factor along the y axis. The default value is 2.qsFilter
- The filter. Default to a quadrant symmetric filter generated from
a Gaussian kernelinterpolation
- The interpolation to use, or null
for the default.
CoverageProcessingException
- if the operation can't be applied.FilteredSubsample
public GridCoverage filteredSubsample(GridCoverage source, int scaleX, int scaleY, float[] qsFilter, Interpolation interpolation, BorderExtender be) throws CoverageProcessingException
filteredSubsample(GridCoverage, int, int, float[], Interpolation)
source
- The source coverage.scaleX
- The scale factor along the x axis. The default value is 2.scaleY
- The scale factor along the y axis. The default value is 2.qsFilter
- The filter. Default to a quadrant symmetric filter generated from a
Gaussian kernelinterpolation
- The interpolation to use, or null
for the default.be
- The border extender, or null
for the default.
CoverageProcessingException
- if the operation can't be applied.FilteredSubsample
public Coverage gradientMagnitude(Coverage source) throws CoverageProcessingException
source
- The source coverage.
CoverageProcessingException
- if the operation can't be applied.GradientMagnitude
public Coverage gradientMagnitude(Coverage source, KernelJAI mask1, KernelJAI mask2) throws CoverageProcessingException
source
- The source coverage.mask1
- The first mask.mask2
- The second mask, orthogonal to the first one.
CoverageProcessingException
- if the operation can't be applied.GradientMagnitude
protected final Coverage doOperation(String operationName, Coverage source) throws OperationNotFoundException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.
OperationNotFoundException
- if there is no operation named operationName
.
CoverageProcessingException
- if the operation can't be applied.protected final Coverage doOperation(String operationName, Coverage source, String argumentName1, Object argumentValue1) throws OperationNotFoundException, InvalidParameterNameException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.argumentName1
- The name of the first parameter to setParameterValue.argumentValue1
- The value for the first parameter.
OperationNotFoundException
- if there is no operation named operationName
.
InvalidParameterNameException
- if there is no parameter with the specified name.
CoverageProcessingException
- if the operation can't be applied.protected final Coverage doOperation(String operationName, Coverage source, String argumentName1, Object argumentValue1, String argumentName2, Object argumentValue2) throws OperationNotFoundException, InvalidParameterNameException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.argumentName1
- The name of the first parameter to setParameterValue.argumentValue1
- The value for the first parameter.argumentName2
- The name of the second parameter to setParameterValue.argumentValue2
- The value for the second parameter.
OperationNotFoundException
- if there is no operation named operationName
.
InvalidParameterNameException
- if there is no parameter with the specified name.
CoverageProcessingException
- if the operation can't be applied.protected final Coverage doOperation(String operationName, Coverage source, String argumentName1, Object argumentValue1, String argumentName2, Object argumentValue2, String argumentName3, Object argumentValue3) throws OperationNotFoundException, InvalidParameterNameException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.argumentName1
- The name of the first parameter to setParameterValue.argumentValue1
- The value for the first parameter.argumentName2
- The name of the second parameter to setParameterValue.argumentValue2
- The value for the second parameter.argumentName3
- The name of the third parameter to setParameterValue.argumentValue3
- The value for the third parameter.
OperationNotFoundException
- if there is no operation named operationName
.
InvalidParameterNameException
- if there is no parameter with the specified name.
CoverageProcessingException
- if the operation can't be applied.protected final Coverage doOperation(String operationName, Coverage source, String argumentName1, Object argumentValue1, String argumentName2, Object argumentValue2, String argumentName3, Object argumentValue3, String argumentName4, Object argumentValue4) throws OperationNotFoundException, InvalidParameterNameException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.
OperationNotFoundException
- if there is no operation named operationName
.
InvalidParameterNameException
- if there is no parameter with the specified name.
CoverageProcessingException
- if the operation can't be applied.protected final Coverage doOperation(String operationName, Coverage source, String argumentName1, Object argumentValue1, String argumentName2, Object argumentValue2, String argumentName3, Object argumentValue3, String argumentName4, Object argumentValue4, String argumentName5, Object argumentValue5) throws OperationNotFoundException, InvalidParameterNameException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.
OperationNotFoundException
- if there is no operation named operationName
.
InvalidParameterNameException
- if there is no parameter with the specified name.
CoverageProcessingException
- if the operation can't be applied.protected final Coverage doOperation(String operationName, Coverage source, String argumentName1, Object argumentValue1, String argumentName2, Object argumentValue2, String argumentName3, Object argumentValue3, String argumentName4, Object argumentValue4, String argumentName5, Object argumentValue5, String argumentName6, Object argumentValue6) throws OperationNotFoundException, InvalidParameterNameException, CoverageProcessingException
operationName
- Name of the operation to be applied to the coverage.source
- The source coverage.
OperationNotFoundException
- if there is no operation named operationName
.
InvalidParameterNameException
- if there is no parameter with the specified name.
CoverageProcessingException
- if the operation can't be applied.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |