Class RasterUtils


  • public class RasterUtils
    extends Object
    • Constructor Detail

      • RasterUtils

        public RasterUtils()
    • 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 raster
        width - the data width in pixels
        Returns:
        whether the data contains the anti-meridian or not
      • getPoleLocations

        public static PixelPos[] getPoleLocations​(GeoRaster geoRaster)
      • toFloat

        public static float[] toFloat​(double[] doubles)
      • toDouble

        public static double[] toDouble​(float[] floats)
      • 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)