Class CoverageDataTiff


public class CoverageDataTiff extends CoverageData<CoverageDataTiffImage>
Tiled Gridded Coverage Data, TIFF Encoding, Extension
Since:
2.0.1
  • Field Details

    • SAMPLES_PER_PIXEL

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

      public static final int BITS_PER_SAMPLE
      Bits per value for floating point coverage data
      See Also:
  • Constructor Details

    • 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 Details

    • createImage

      public CoverageDataTiffImage createImage(TileRow tileRow)
      Create a coverage data image
      Specified by:
      createImage in class CoverageData<CoverageDataTiffImage>
      Parameters:
      tileRow - tile row
      Returns:
      image
    • 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
    • getValue

      public Double getValue(GriddedTile griddedTile, CoverageDataTiffImage image, int x, int y)
      Specified by:
      getValue in class CoverageDataCore<CoverageDataTiffImage>
    • 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
    • getValues

      public Double[] getValues(GriddedTile griddedTile, byte[] imageBytes)
      Get the coverage data values
      Specified by:
      getValues in class CoverageData<CoverageDataTiffImage>
      Parameters:
      griddedTile - gridded tile
      imageBytes - image bytes
      Returns:
      coverage data values
    • 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 values 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 TIFF 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 TIFF bytes from the double array of 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