|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.referencing.operation.transform.DimensionFilter
An utility class for the separation of concatenation of pass through transforms. Given an arbitrary math transform, this utility class will returns a new math transform that operates only of a given set of source dimensions. For example if the supplied has (x, y, z) inputs and (longitude, latitude, height) outputs, then the following code:
addSourceDimensionRange(0, 2); MathTransform mt = separate(transform);
will returns a transform with (x, y) inputs and (probably)
(longitude, latitude) outputs. The later can be verified with
a call to getTargetDimensions()
.
CoordinateOperation
interfaces instead
of math transforms. We should revisit this issue after grid coverage API has been
revisited (since grid coverage is a user of this class)., This class contains a set of static methods that could be factored out in
some kind of implementation.Constructor Summary | |
DimensionFilter()
Constructs a dimension filter with the default math transform factory. |
|
DimensionFilter(org.opengis.referencing.operation.MathTransformFactory factory)
Constructs a dimension filter with the specified factory. |
Method Summary | |
void |
addSourceDimension(int dimension)
Add an input dimension to keep. |
void |
addSourceDimensionRange(int lower,
int upper)
Add a range of input dimensions to keep. |
void |
addSourceDimensions(int[] dimensions)
Add input dimensions to keep. |
void |
addTargetDimension(int dimension)
Add an output dimension to keep. |
void |
addTargetDimensionRange(int lower,
int upper)
Add a range of output dimensions to keep. |
void |
addTargetDimensions(int[] dimensions)
Add output dimensions to keep. |
void |
clear()
Clear any source and target dimension setting. |
int[] |
getSourceDimensions()
Returns the input dimensions. |
int[] |
getTargetDimensions()
Returns the output dimensions. |
org.opengis.referencing.operation.MathTransform |
separate(org.opengis.referencing.operation.MathTransform transform)
Separates the specified math transform. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DimensionFilter()
public DimensionFilter(org.opengis.referencing.operation.MathTransformFactory factory)
factory
- The factory for the creation of new math transforms.Method Detail |
public void clear()
public void addSourceDimension(int dimension) throws java.lang.IllegalArgumentException
separate(transform)
.
The number must be in the range 0 inclusive to
transform.getSourceDimensions()
exclusive.
dimension
- The dimension to add.
java.lang.IllegalArgumentException
- if is negative.public void addSourceDimensions(int[] dimensions) throws java.lang.IllegalArgumentException
separate(transform)
.
All numbers must be in the range 0 inclusive to
transform.getSourceDimensions()
exclusive. The values must be in strictly increasing order.
dimensions
- The new sequence of dimensions.
java.lang.IllegalArgumentException
- if contains negative values or
is not a strictly increasing sequence.public void addSourceDimensionRange(int lower, int upper) throws java.lang.IllegalArgumentException
separate(transform)
.
lower
- The lower dimension, inclusive. Must not be smaller than 0.upper
- The upper dimension, exclusive. Must not be greater than
transform.getSourceDimensions()
.
java.lang.IllegalArgumentException
public int[] getSourceDimensions() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if input dimensions have not been set.public void addTargetDimension(int dimension) throws java.lang.IllegalArgumentException
separate(transform)
.
The number must be in the range 0 inclusive to
transform.getTargetDimensions()
exclusive.
dimension
- The dimension to add.
java.lang.IllegalArgumentException
- if is negative.public void addTargetDimensions(int[] dimensions) throws java.lang.IllegalArgumentException
separate(transform)
.
All numbers must be in the range 0 inclusive to
transform.getTargetDimensions()
exclusive. The values must be in strictly increasing order.
dimensions
- The new sequence of dimensions.
java.lang.IllegalArgumentException
- if contains negative values or
is not a strictly increasing sequence.public void addTargetDimensionRange(int lower, int upper) throws java.lang.IllegalArgumentException
separate(transform)
.
lower
- The lower dimension, inclusive. Must not be smaller than 0.upper
- The upper dimension, exclusive. Must not be greater than
transform.getTargetDimensions()
.
java.lang.IllegalArgumentException
public int[] getTargetDimensions() throws java.lang.IllegalStateException
separate(transform)
has been invoked at least once, in which case the target dimensions are inferred
automatically from the source dimensions and the
.
java.lang.IllegalStateException
- if this information is not available.public org.opengis.referencing.operation.MathTransform separate(org.opengis.referencing.operation.MathTransform transform) throws org.opengis.referencing.FactoryException
If source dimensions are unspecified, then the returned transform will expects all source dimensions as input but will produces only the specified target dimensions as output.
If target dimensions are unspecified, then the returned transform will expects only the specified source dimensions as input, and the target dimensions will be inferred automatically.
transform
- The transform to separate.
org.opengis.referencing.FactoryException
- if the transform can't be separated.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |