Package org.esa.snap.core.util
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 Summary
Constructors Constructor Description AreaCalculator(GeoCoding gc)
Initialise the calculator with anGeoCoding
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculatePixelSize(int x, int y)
Calculates the size of the pixel specified by the given x,y coordinates.double
calculateRectangleSize(Rectangle2D rectangle)
Calculates the size of the area of the rectangle specified.double
getEarthRadius()
The earth radius used for the calculation
-
-
-
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 alwaysmeter
.- Parameters:
x
- the x location of the pixely
- 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 alwaysmeter
.- Parameters:
rectangle
- rectangle of the area in latitude/longitude coordinates- Returns:
- the size in square meters
-
-