Class WarpBuilder
- Object
-
- WarpBuilder
-
public class WarpBuilder extends Object
BuildsWarp
objects that approximate a specifiedMathTransform
in a certain rectangular domain within the specified tolerance- Author:
- Andrea Aime - GeoSolutions
-
-
Constructor Summary
Constructors Constructor Description WarpBuilder(double tolerance)
Creates a new warp builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Warp
buildWarp(MathTransform2D mt, Rectangle domain)
int[]
getRowColsSplit(MathTransform2D mt, Rectangle2D.Double domain)
Given a math transform and a source domain, return the number of rows and cols by which the domain should be split to avoid transform linearity issues, or null if it could not be found.boolean
isValidDomain(Rectangle2D.Double domain)
Returns true if the given domain is valid for the splitting algorithm.void
setMaxPositions(int maxPositions)
Sets the maximum number of positions in the optimized grid, in case we have more we'll fall back to the warp adapter.
-
-
-
Method Detail
-
setMaxPositions
public void setMaxPositions(int maxPositions)
Sets the maximum number of positions in the optimized grid, in case we have more we'll fall back to the warp adapter. By default there is no limit
-
isValidDomain
public boolean isValidDomain(Rectangle2D.Double domain)
Returns true if the given domain is valid for the splitting algorithm. Can be called before getRowColsSplit to prevent exceptions. UnlikebuildWarp(MathTransform2D, Rectangle)
the domain here can be expressed in geographic coordinates, so there is no requirement that the area is at least 1x1 (in geographic coordiantes, that's a massive area), but only that it's not empty- Parameters:
domain
- domain to check
-
getRowColsSplit
public int[] getRowColsSplit(MathTransform2D mt, Rectangle2D.Double domain)
Given a math transform and a source domain, return the number of rows and cols by which the domain should be split to avoid transform linearity issues, or null if it could not be found.
-
buildWarp
public Warp buildWarp(MathTransform2D mt, Rectangle domain) throws TransformException
- Parameters:
mt
- The math transform to be approximateddomain
- The domain in which the transform will be approximated- Throws:
TransformException
-
-