Class AreaCalculator

java.lang.Object
org.esa.snap.core.util.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 Details

    • 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 Details

    • 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