Class AreaCalculator


  • public class AreaCalculator
    extends Object
    Calculates the size of an specified area in square meter. The size is computed considering the latitudinal area correction.
    • Constructor Detail

      • AreaCalculator

        public AreaCalculator​(GeoCoding gc)
        Initialise the calculator with an GeoCoding. The earth radius ist retrieved from the ellipsoid from the underlying map crs of the geo-coding. If this is not possible a default mean earth radius us used.
        Parameters:
        gc - the geo-coding
    • Method Detail

      • getEarthRadius

        public double getEarthRadius()
        The earth radius used for the calculation
        Returns:
        the earth radius in meter
      • calculatePixelSize

        public double calculatePixelSize​(int x,
                                         int y)
        Calculates the size of the pixel specified by the given x,y coordinates. The unit of the size is always meter.
        Parameters:
        x - the x location of the pixel
        y - the y location of the pixel
        Returns:
        the size in square meters
      • calculateRectangleSize

        public double calculateRectangleSize​(Rectangle2D rectangle)
        Calculates the size of the area of the rectangle specified. The rectangle needs to be specified in geo-graphical latitude/longitude coordinates The unit of the size is always meter.
        Parameters:
        rectangle - rectangle of the area in latitude/longitude coordinates
        Returns:
        the size in square meters