Class CoverageDataTiff
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.coverage.CoverageDataCore<TImage>
-
- mil.nga.geopackage.extension.coverage.CoverageData<CoverageDataTiffImage>
-
- mil.nga.geopackage.extension.coverage.CoverageDataTiff
-
public class CoverageDataTiff extends CoverageData<CoverageDataTiffImage>
Tiled Gridded Coverage Data, TIFF Encoding, Extension- Since:
- 2.0.1
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static intBITS_PER_SAMPLEBits per value for floating point coverage datastatic intSAMPLES_PER_PIXELSingle sample coverage data-
Fields inherited from class mil.nga.geopackage.extension.coverage.CoverageData
tileDao
-
Fields inherited from class mil.nga.geopackage.extension.coverage.CoverageDataCore
algorithm, coverageBoundingBox, coverageProjection, encoding, EXTENSION_AUTHOR, EXTENSION_DEFINITION, EXTENSION_NAME, EXTENSION_NAME_NO_AUTHOR, GRIDDED_COVERAGE, height, requestProjection, sameProjection, width, zoomIn, zoomInBeforeOut, zoomOut
-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Constructor Description CoverageDataTiff(GeoPackage geoPackage, TileDao tileDao)Constructor, use the coverage data tables pixel tile size as the request size width and heightCoverageDataTiff(GeoPackage geoPackage, TileDao tileDao, Integer width, Integer height, Projection requestProjection)ConstructorCoverageDataTiff(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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CoverageDataTiffImagecreateImage(int tileWidth, int tileHeight)Create a new imageCoverageDataTiffImagecreateImage(TileRow tileRow)Create a coverage data imagestatic CoverageDataTiffcreateTileTable(GeoPackage geoPackage, TileTableMetadata metadata)Create the coverage data tile table with metadata and extensionCoverageDataTiffImagedrawTile(float[][] pixelValues)Draw a coverage data image tile from the double array of float pixel values formatted as float[row][width]CoverageDataTiffImagedrawTile(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) + xCoverageDataTiffImagedrawTile(GriddedTile griddedTile, Double[][] values)Draw a coverage data image tile from the double array of coverage data values formatted as Double[row][width]CoverageDataTiffImagedrawTile(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) + xbyte[]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]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) + xbyte[]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]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) + xfloatgetPixelValue(byte[] imageBytes, int x, int y)Get the pixel value as a float from the image and the coordinatefloat[]getPixelValues(byte[] imageBytes)Get the pixel values of the image as floatsDoublegetValue(GriddedTile griddedTile, byte[] imageBytes, int x, int y)Get the coverage data valueDoublegetValue(GriddedTile griddedTile, CoverageDataTiffImage image, int x, int y)doublegetValue(GriddedTile griddedTile, TileRow tileRow, int x, int y)Get the coverage data value of the pixel in the tile row imageDouble[]getValues(GriddedTile griddedTile, byte[] imageBytes)Get the coverage data valuesvoidsetPixelValue(CoverageDataTiffImage image, int x, int y, float pixelValue)Set the pixel value into the imagestatic voidvalidateImageType(FileDirectory directory)Validate that the image type-
Methods inherited from class mil.nga.geopackage.extension.coverage.CoverageData
createTileTable, getCoverageData, getCoverageData, getCoverageData, getTileDao, getValue, getValues, getValuesUnbounded
-
Methods inherited from class mil.nga.geopackage.extension.coverage.CoverageDataCore
createGriddedCoverageTable, createGriddedTileTable, createTileTable, formatUnboundedResults, getAlgorithm, getBicubicInterpolationValue, getBicubicInterpolationValue, getBicubicInterpolationValue, getBilinearInterpolationValue, getBilinearInterpolationValue, getBilinearInterpolationValue, getBilinearInterpolationValue, getCoverageBoundingBox, getCoverageProjection, getCubicInterpolationValue, getCubicInterpolationValue, getDataNull, getEncoding, getFloatPixelValue, getGriddedCoverage, getGriddedCoverageDao, getGriddedCoverageDao, getGriddedCoverageDao, getGriddedTile, getGriddedTile, getGriddedTileDao, getGriddedTileDao, getGriddedTileDao, getHeight, getNearestNeighbors, getNearestNeighborValue, getOrCreate, getPixelValue, getPixelValue, getPixelValue, getPixelValue, getRequestProjection, getTables, getTileMatrixSet, getUnsignedPixelValue, getUnsignedPixelValue, getUnsignedPixelValue, getUnsignedPixelValue, getUnsignedPixelValues, getValue, getValue, getValue, getValue, getValues, getValues, getValues, getValues, getValues, getValues, getValuesUnbounded, getWidth, getXSource, getXSourceMinAndMax, getYSource, getYSourceMinAndMax, has, isDataNull, isSameProjection, isZoomIn, isZoomInBeforeOut, isZoomOut, padBoundingBox, queryGriddedCoverage, reprojectCoverageData, setAlgorithm, setEncoding, setHeight, setWidth, setZoomIn, setZoomInBeforeOut, setZoomOut
-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, has, has, verifyWritable
-
-
-
-
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- GeoPackagetileDao- tile daowidth- coverage data response widthheight- coverage data response heightrequestProjection- 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- GeoPackagetileDao- 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- GeoPackagetileDao- tile daorequestProjection- request projection
-
-
Method Detail
-
createImage
public CoverageDataTiffImage createImage(TileRow tileRow)
Create a coverage data image- Specified by:
createImagein classCoverageData<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:
getValuein classCoverageData<CoverageDataTiffImage>- Parameters:
griddedTile- gridded tiletileRow- tile rowx- x coordinatey- y coordinate- Returns:
- coverage data value
-
getValue
public Double getValue(GriddedTile griddedTile, CoverageDataTiffImage image, int x, int y)
- Specified by:
getValuein classCoverageDataCore<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 bytesx- x coordinatey- 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:
getValuein classCoverageData<CoverageDataTiffImage>- Parameters:
griddedTile- gridded tileimageBytes- image bytesx- x coordinatey- y coordinate- Returns:
- coverage data value
-
getValues
public Double[] getValues(GriddedTile griddedTile, byte[] imageBytes)
Get the coverage data values- Specified by:
getValuesin classCoverageData<CoverageDataTiffImage>- Parameters:
griddedTile- gridded tileimageBytes- 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 * tileHeighttileWidth- tile widthtileHeight- 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 * tileHeighttileWidth- tile widthtileHeight- 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 tilevalues- coverage data values of length tileWidth * tileHeighttileWidth- tile widthtileHeight- 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:
drawTileDatain classCoverageData<CoverageDataTiffImage>- Parameters:
griddedTile- gridded tilevalues- coverage data values of length tileWidth * tileHeighttileWidth- tile widthtileHeight- 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 tilevalues- 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:
drawTileDatain classCoverageData<CoverageDataTiffImage>- Parameters:
griddedTile- gridded tilevalues- 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 widthtileHeight- 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- imagex- x coordinatey- y coordinatepixelValue- pixel value
-
createTileTable
public static CoverageDataTiff createTileTable(GeoPackage geoPackage, TileTableMetadata metadata)
Create the coverage data tile table with metadata and extension- Parameters:
geoPackage- GeoPackagemetadata- tile table metadata- Returns:
- coverage data
- Since:
- 4.0.0
-
-