Class RasterUtils
java.lang.Object
org.esa.snap.core.dataio.geocoding.util.RasterUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublecomputeResolutionInKm(double[] lonData, double[] latData, int width, int height) static booleancontainsAntiMeridian(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)
-
Constructor Details
-
RasterUtils
public RasterUtils()
-
-
Method Details
-
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
-
getPoleLocations
-
toFloat
public static float[] toFloat(double[] doubles) -
toDouble
public static double[] toDouble(float[] floats) -
loadDataScaled
- Throws:
IOException
-
loadData
- Throws:
IOException
-
loadGeoData
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)
-