Class WarpBuilder


  • public class WarpBuilder
    extends Object
    Builds Warp objects that approximate a specified MathTransform in a certain rectangular domain within the specified tolerance
    Author:
    Andrea Aime - GeoSolutions
    • Constructor Detail

      • WarpBuilder

        public WarpBuilder​(double tolerance)
        Creates a new warp builder
    • 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. Unlike buildWarp(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.