Class RasterUtils
- java.lang.Object
-
- org.esa.snap.core.dataio.geocoding.util.RasterUtils
-
public class RasterUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description RasterUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
computeResolutionInKm(double[] lonData, double[] latData, int width, int height)
static boolean
containsAntiMeridian(double[] longitudes, int width)
Checks if the longitude data raster contains the anti-meridian.static PixelPos[]
getPoleLocations(GeoRaster geoRaster)
static double[]
loadData(RasterDataNode dataNode)
static double[]
loadDataScaled(RasterDataNode dataNode)
static double[]
loadGeoData(RasterDataNode dataNode)
loads geo-location data as an array of doubles ready to use by ComponentGeoCoding.static double[]
toDouble(float[] floats)
static float[]
toFloat(double[] doubles)
-
-
-
Method Detail
-
containsAntiMeridian
public static boolean containsAntiMeridian(double[] longitudes, int width)
Checks if the longitude data raster contains the anti-meridian. Runs along the raster borders and if a longitude-delta larger than 180 deg is detected, an anti-meridian crossing is contained in the data.- Parameters:
longitudes
- the longitude rasterwidth
- the data width in pixels- Returns:
- whether the data contains the anti-meridian or not
-
toFloat
public static float[] toFloat(double[] doubles)
-
toDouble
public static double[] toDouble(float[] floats)
-
loadDataScaled
public static double[] loadDataScaled(RasterDataNode dataNode) throws IOException
- Throws:
IOException
-
loadData
public static double[] loadData(RasterDataNode dataNode) throws IOException
- Throws:
IOException
-
loadGeoData
public static double[] loadGeoData(RasterDataNode dataNode) throws IOException
loads geo-location data as an array of doubles ready to use by ComponentGeoCoding. This method optimises the memory impact by disposing whatever is possible after the reading operation. Please do not use from a context where this is not desired.- Parameters:
dataNode
- the raster data node providing the geolocation data- Returns:
- the scaled array of geo-location values
- Throws:
IOException
- on disk-access errors
-
computeResolutionInKm
public static double computeResolutionInKm(double[] lonData, double[] latData, int width, int height)
-
-