Class WarpBuilder
Object
WarpBuilder
Builds
Warp
objects that approximate a specified MathTransform
in a certain rectangular domain within
the specified tolerance- Author:
- Andrea Aime - GeoSolutions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionWarp
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.
-
Constructor Details
-
WarpBuilder
public WarpBuilder(double tolerance) Creates a new warp builder
-
-
Method Details
-
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
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
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
- Parameters:
mt
- The math transform to be approximateddomain
- The domain in which the transform will be approximated- Throws:
TransformException
-