public class LinearTransformBuilder extends TransformBuilder
LinearTransformBuilder(int...)
constructor will be more efficient.
Otherwise a builder created by the LinearTransformBuilder()
constructor will be able to handle
randomly distributed coordinates.
The transform coefficients are determined using a least squares estimation method, with the assumption that source positions are exact and all the uncertainty is in the target positions.
LocalizationGridBuilder
,
LinearTransform
,
Line
,
Plane
Defined in the sisreferencing
module
Constructor and Description 

LinearTransformBuilder()
Creates a new linear transform builder for randomly distributed positions.

LinearTransformBuilder(int... gridSize)
Creates a new linear transform builder for source positions distributed on a regular grid.

Modifier and Type  Method and Description 

double[] 
correlation()
Returns the correlation coefficients of the last transform created by
create() ,
or null if none. 
LinearTransform 
create()
Deprecated.
Replaced by
create(MathTransformFactory) . 
LinearTransform 
create(MathTransformFactory factory)
Creates a linear transform approximation from the source positions to the target positions.

double[] 
getControlPoint(int[] source)
Returns a single target coordinate for the given source coordinate, or
null if none. 
int 
getSourceDimensions()
Returns the number of dimensions in source positions.

int 
getTargetDimensions()
Returns the number of dimensions in target positions.

void 
setControlPoint(int[] source,
double[] target)
Sets a single matching control point pair.

void 
setControlPoints(Map<? extends Position,? extends Position> sourceToTarget)
Sets all matching control point pairs, overwriting any previous setting.

void 
setSourcePoints(DirectPosition... points)
Deprecated.
Replaced by
setControlPoints(Map) . 
void 
setTargetPoints(DirectPosition... points)
Deprecated.
Replaced by
setControlPoints(Map) . 
String 
toString()
Returns a string representation of this builder for debugging purpose.

public LinearTransformBuilder()
LinearTransformBuilder(int...)
constructor will create a more efficient builder.
public LinearTransformBuilder(int... gridSize)
LinearTransformBuilder
that ordinate values of all source positions will
be integers in the [0 … gridSize[0]
1] range for the first dimension (typically column indices),
in the [0 … gridSize[1]
1] range for the second dimension (typically row indices), etc.
The dimension of all source positions is the length of the given gridSize
array.
An empty array is equivalent to invoking the noargument constructor, i.e. no restriction is put on the source coordinates.
gridSize
 the number of integer ordinate values in each grid dimension.IllegalArgumentException
 if a grid size is not strictly positive, or if the product
of all values (∏gridSize
) is greater than Integer.MAX_VALUE
.public int getSourceDimensions()
IllegalStateException
 if the number of source dimensions is not yet known.MathTransform.getSourceDimensions()
public int getTargetDimensions()
IllegalStateException
 if the number of target dimensions is not yet known.MathTransform.getTargetDimensions()
public void setControlPoints(Map<? extends Position,? extends Position> sourceToTarget) throws MismatchedDimensionException
All source positions shall have the same number of dimensions (the source dimension), and all target positions shall have the same number of dimensions (the target dimension). However the source dimension does not need to be the same the target dimension. Apache SIS currently supports only one or twodimensional source positions, together with arbitrary target dimension.
If this builder has been created with the LinearTransformBuilder(int...)
constructor,
then the ordinate values of all source positions shall be integers in the [0 … gridSize[0]
1]
range for the first dimension (typically column indices), in the [0 … gridSize[1]
1] range for
the second dimension (typically row indices), etc. This constraint does not apply for builders
created with the LinearTransformBuilder()
constructor.
sourceToTarget
 a map of source positions to target positions.
Source positions are assumed precise and target positions are assumed uncertain.IllegalArgumentException
 if this builder has been created for a grid but some source ordinates are not indices in that grid.MismatchedDimensionException
 if some positions do not have the expected number of dimensions.public void setControlPoint(int[] source, double[] target)
setControlPoints(Map)
method is a more efficient alternative.source
 the source coordinates. If this builder has been created with the LinearTransformBuilder(int...)
constructor,
then for every index i the source[i]
value shall be in the [0 … gridSize[i]
1] range inclusive.
If this builder has been created with the LinearTransformBuilder()
constructor, then no constraint apply.target
 the target coordinates, assumed uncertain.IllegalArgumentException
 if this builder has been created for a grid
but some source ordinates are out of index range.MismatchedDimensionException
 if the source or target position does not have the expected number of dimensions.public double[] getControlPoint(int[] source)
null
if none.
This method can be used for retrieving points set by previous calls to
setControlPoint(int[], double[])
or setControlPoints(Map)
.
source
 the source coordinates. If this builder has been created with the LinearTransformBuilder(int...)
constructor,
then for every index i the source[i]
value shall be in the [0 … gridSize[i]
1] range inclusive.
If this builder has been created with the LinearTransformBuilder()
constructor, then no constraint apply.null
if none.IllegalArgumentException
 if this builder has been created for a grid
but some source ordinates are out of index range.MismatchedDimensionException
 if the source position does not have the expected number of dimensions.@Deprecated public void setSourcePoints(DirectPosition... points) throws MismatchedDimensionException
setControlPoints(Map)
.create()
method will be invoked.
In current Apache SIS implementation, the source points must be one or twodimensional.
If this builder has been created with the LinearTransformBuilder(int...)
constructor,
then all given points must be twodimensional and all ordinate values must be integers in the
[0 … width1] or [0 … height1] range for the first and second dimension
respectively. This constraint does not apply if this builder has been created with the
LinearTransformBuilder()
constructor.
It is caller's responsibility to ensure that no source point is duplicated.
If the same source point is repeated twice, then LinearTransformBuilder
behavior is undefined.
points
 the source points, assumed precise.MismatchedDimensionException
 if at least one point does not have the expected number of dimensions.@Deprecated public void setTargetPoints(DirectPosition... points) throws MismatchedDimensionException
setControlPoints(Map)
.create()
method will be invoked.
Target points can have any number of dimensions (not necessarily 2), but all points shall have
the same number of dimensions.points
 the target points, assumed uncertain.MismatchedDimensionException
 if not all points have the same number of dimensions.@Deprecated public LinearTransform create()
create(MathTransformFactory)
.public LinearTransform create(MathTransformFactory factory) throws FactoryException
create
in class TransformBuilder
factory
 the factory to use for creating the transform, or null
for the default factory.
The MathTransformFactory.createAffineTransform(Matrix)
method of that factory
shall return LinearTransform
instances.FactoryException
 if the transform can not be created,
for example because the source or target points have not be specified.public double[] correlation()
create()
,
or null
if none. If nonnull, the array length is equals to the number of target
dimensions.null
.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.