Class CoverageDataTiff

    • Field Detail

      • SAMPLES_PER_PIXEL

        public static final int SAMPLES_PER_PIXEL
        Single sample coverage data
        See Also:
        Constant Field Values
      • BITS_PER_SAMPLE

        public static final int BITS_PER_SAMPLE
        Bits per value for floating point coverage data
        See Also:
        Constant Field Values
    • Constructor Detail

      • CoverageDataTiff

        public CoverageDataTiff​(GeoPackage geoPackage,
                                TileDao tileDao,
                                Integer width,
                                Integer height,
                                Projection requestProjection)
        Constructor
        Parameters:
        geoPackage - GeoPackage
        tileDao - tile dao
        width - coverage data response width
        height - coverage data response height
        requestProjection - request projection
      • CoverageDataTiff

        public CoverageDataTiff​(GeoPackage geoPackage,
                                TileDao tileDao)
        Constructor, use the coverage data tables pixel tile size as the request size width and height
        Parameters:
        geoPackage - GeoPackage
        tileDao - tile dao
      • CoverageDataTiff

        public CoverageDataTiff​(GeoPackage geoPackage,
                                TileDao tileDao,
                                Projection requestProjection)
        Constructor, use the coverage data tables pixel tile size as the request size width and height, request as the specified projection
        Parameters:
        geoPackage - GeoPackage
        tileDao - tile dao
        requestProjection - request projection
    • Method Detail

      • getValue

        public double getValue​(GriddedTile griddedTile,
                               TileRow tileRow,
                               int x,
                               int y)
        Get the coverage data value of the pixel in the tile row image
        Specified by:
        getValue in class CoverageData<CoverageDataTiffImage>
        Parameters:
        griddedTile - gridded tile
        tileRow - tile row
        x - x coordinate
        y - y coordinate
        Returns:
        coverage data value
      • getPixelValue

        public float getPixelValue​(byte[] imageBytes,
                                   int x,
                                   int y)
        Get the pixel value as a float from the image and the coordinate
        Parameters:
        imageBytes - image bytes
        x - x coordinate
        y - y coordinate
        Returns:
        float pixel value
      • getPixelValues

        public float[] getPixelValues​(byte[] imageBytes)
        Get the pixel values of the image as floats
        Parameters:
        imageBytes - image bytes
        Returns:
        float pixel values
      • validateImageType

        public static void validateImageType​(FileDirectory directory)
        Validate that the image type
        Parameters:
        directory - file directory
      • getValue

        public Double getValue​(GriddedTile griddedTile,
                               byte[] imageBytes,
                               int x,
                               int y)
        Get the coverage data value
        Specified by:
        getValue in class CoverageData<CoverageDataTiffImage>
        Parameters:
        griddedTile - gridded tile
        imageBytes - image bytes
        x - x coordinate
        y - y coordinate
        Returns:
        coverage data value
      • drawTile

        public CoverageDataTiffImage drawTile​(float[] pixelValues,
                                              int tileWidth,
                                              int tileHeight)
        Draw a coverage data image tile from the flat array of float pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x
        Parameters:
        pixelValues - float pixel values of length tileWidth * tileHeight
        tileWidth - tile width
        tileHeight - tile height
        Returns:
        coverage data image tile
      • drawTileData

        public byte[] drawTileData​(float[] pixelValues,
                                   int tileWidth,
                                   int tileHeight)
        Draw a coverage data image tile and format as TIFF bytes from the flat array of float pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x
        Parameters:
        pixelValues - float pixel values of length tileWidth * tileHeight
        tileWidth - tile width
        tileHeight - tile height
        Returns:
        coverage data image tile bytes
      • drawTile

        public CoverageDataTiffImage drawTile​(float[][] pixelValues)
        Draw a coverage data image tile from the double array of float pixel values formatted as float[row][width]
        Parameters:
        pixelValues - float pixel values as [row][width]
        Returns:
        coverage data image tile
      • drawTileData

        public byte[] drawTileData​(float[][] pixelValues)
        Draw a coverage data image tile and format as TIFF bytes from the double array of float pixel values formatted as float[row][width]
        Parameters:
        pixelValues - float pixel values as [row][width]
        Returns:
        coverage data image tile bytes
      • drawTile

        public CoverageDataTiffImage drawTile​(GriddedTile griddedTile,
                                              Double[] values,
                                              int tileWidth,
                                              int tileHeight)
        Draw a coverage data image tile from the flat array of coverage data of length tileWidth * tileHeight where each coverage data value is at: (y * tileWidth) + x
        Parameters:
        griddedTile - gridded tile
        values - coverage data values of length tileWidth * tileHeight
        tileWidth - tile width
        tileHeight - tile height
        Returns:
        coverage data image tile
      • drawTileData

        public byte[] drawTileData​(GriddedTile griddedTile,
                                   Double[] values,
                                   int tileWidth,
                                   int tileHeight)
        Draw a coverage data image tile and format as image bytes from the flat array of coverage data values of length tileWidth * tileHeight where each coverage data value is at: (y * tileWidth) + x
        Specified by:
        drawTileData in class CoverageData<CoverageDataTiffImage>
        Parameters:
        griddedTile - gridded tile
        values - coverage data values of length tileWidth * tileHeight
        tileWidth - tile width
        tileHeight - tile height
        Returns:
        coverage data image tile bytes
      • drawTile

        public CoverageDataTiffImage drawTile​(GriddedTile griddedTile,
                                              Double[][] values)
        Draw a coverage data image tile from the double array of coverage data values formatted as Double[row][width]
        Parameters:
        griddedTile - gridded tile
        values - coverage data values as [row][width]
        Returns:
        coverage data image tile
      • drawTileData

        public byte[] drawTileData​(GriddedTile griddedTile,
                                   Double[][] values)
        Draw a coverage data image tile and format as image bytes from the double array of unsigned coverage data values formatted as Double[row][width]
        Specified by:
        drawTileData in class CoverageData<CoverageDataTiffImage>
        Parameters:
        griddedTile - gridded tile
        values - coverage data values as [row][width]
        Returns:
        coverage data image tile bytes
      • createImage

        public CoverageDataTiffImage createImage​(int tileWidth,
                                                 int tileHeight)
        Create a new image
        Parameters:
        tileWidth - tile width
        tileHeight - tile height
        Returns:
        image
      • setPixelValue

        public void setPixelValue​(CoverageDataTiffImage image,
                                  int x,
                                  int y,
                                  float pixelValue)
        Set the pixel value into the image
        Parameters:
        image - image
        x - x coordinate
        y - y coordinate
        pixelValue - pixel value
      • createTileTable

        public static CoverageDataTiff createTileTable​(GeoPackage geoPackage,
                                                       TileTableMetadata metadata)
        Create the coverage data tile table with metadata and extension
        Parameters:
        geoPackage - GeoPackage
        metadata - tile table metadata
        Returns:
        coverage data
        Since:
        4.0.0