Class CoverageDataPng
java.lang.Object
mil.nga.geopackage.extension.BaseExtension
mil.nga.geopackage.extension.coverage.CoverageDataCore<TImage>
mil.nga.geopackage.extension.coverage.CoverageData<CoverageDataPngImage>
mil.nga.geopackage.extension.coverage.CoverageDataPng
Tiled Gridded Coverage Data, PNG Encoding, Extension
- Since:
- 2.0.1
-
Field Summary
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
ConstructorDescriptionCoverageDataPng
(GeoPackage geoPackage, TileDao tileDao) Constructor, use the coverage data tables pixel tile size as the request size width and heightCoverageDataPng
(GeoPackage geoPackage, TileDao tileDao, Integer width, Integer height, Projection requestProjection) ConstructorCoverageDataPng
(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
Modifier and TypeMethodDescriptioncreateImage
(int tileWidth, int tileHeight) Create a new 16 bit single channel imagecreateImage
(TileRow tileRow) Create a coverage data imagestatic CoverageDataPng
createTileTable
(GeoPackage geoPackage, TileTableMetadata metadata) Create the coverage data tile table with metadata and extensiondrawTile
(int[][] unsignedPixelValues) Draw a coverage data image tile from the double array of unsigned 16 bit integer pixel values formatted as int[row][width]drawTile
(int[] unsignedPixelValues, int tileWidth, int tileHeight) Draw a coverage data image tile from the flat array of unsigned 16 bit integer pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + xdrawTile
(short[][] pixelValues) Draw a coverage data tile from the double array of "unsigned short" pixel values formatted as short[row][width]drawTile
(short[] pixelValues, int tileWidth, int tileHeight) Draw a coverage data image tile from the flat array of "unsigned short" pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + xdrawTile
(GriddedTile griddedTile, Double[][] values) Draw a coverage data image tile from the double array of unsigned coverage data values formatted as Double[row][width]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) + xbyte[]
drawTileData
(int[][] unsignedPixelValues) Draw a coverage data image tile and format as PNG bytes from the double array of unsigned 16 bit integer pixel values formatted as int[row][width]byte[]
drawTileData
(int[] unsignedPixelValues, int tileWidth, int tileHeight) Draw a coverage data image tile and format as PNG bytes from the flat array of unsigned 16 bit integer pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + xbyte[]
drawTileData
(short[][] pixelValues) Draw a coverage data tile and format as PNG bytes from the double array of "unsigned short" pixel values formatted as short[row][width]byte[]
drawTileData
(short[] pixelValues, int tileWidth, int tileHeight) Draw a coverage data image tile and format as PNG bytes from the flat array of "unsigned short" 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 TIFF bytes from the double array of 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 TIFF bytes from the flat array of coverage data values of length tileWidth * tileHeight where each coverage data value is at: (y * tileWidth) + xint
getPixelValue
(byte[] imageBytes, int x, int y) Get the pixel value as a 16 bit unsigned integer valueint[]
getPixelValues
(byte[] imageBytes) Get the pixel values of the image as 16 bit unsigned integer valuesgetValue
(GriddedTile griddedTile, byte[] imageBytes, int x, int y) Get the coverage data valuegetValue
(GriddedTile griddedTile, CoverageDataPngImage image, int x, int y) double
getValue
(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 valuesvoid
setPixelValue
(int[] row, int x, int unsignedPixelValue) Set the pixel valuevoid
setPixelValue
(int[] row, int x, short pixelValue) Set the pixel valuevoid
setPixelValue
(ImageLineInt row, int x, int unsignedPixelValue) Set the pixel valuevoid
setPixelValue
(ImageLineInt row, int x, short pixelValue) Set the pixel valuestatic void
validateImageType
(PngReader reader) Validate that the image type is single channel 16 bitMethods 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
-
Constructor Details
-
CoverageDataPng
public CoverageDataPng(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
-
CoverageDataPng
Constructor, use the coverage data tables pixel tile size as the request size width and height- Parameters:
geoPackage
- GeoPackagetileDao
- tile dao
-
CoverageDataPng
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 Details
-
createImage
Create a coverage data image- Specified by:
createImage
in classCoverageData<CoverageDataPngImage>
- Parameters:
tileRow
- tile row- Returns:
- image
-
getValue
Get the coverage data value of the pixel in the tile row image- Specified by:
getValue
in classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tiletileRow
- tile rowx
- x coordinatey
- y coordinate- Returns:
- coverage data value
-
getValue
- Specified by:
getValue
in classCoverageDataCore<CoverageDataPngImage>
-
getPixelValue
public int getPixelValue(byte[] imageBytes, int x, int y) Get the pixel value as a 16 bit unsigned integer value- Parameters:
imageBytes
- image bytesx
- x coordinatey
- y coordinate- Returns:
- pixel value
-
getPixelValues
public int[] getPixelValues(byte[] imageBytes) Get the pixel values of the image as 16 bit unsigned integer values- Parameters:
imageBytes
- image bytes- Returns:
- 16 bit unsigned integer pixel values
-
validateImageType
Validate that the image type is single channel 16 bit- Parameters:
reader
- png reader
-
getValue
Get the coverage data value- Specified by:
getValue
in classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tileimageBytes
- image bytesx
- x coordinatey
- y coordinate- Returns:
- coverage data value
-
getValues
Get the coverage data values- Specified by:
getValues
in classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tileimageBytes
- image bytes- Returns:
- coverage data values
-
drawTile
Draw a coverage data image tile from the flat array of "unsigned short" pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x- Parameters:
pixelValues
- "unsigned short" pixel values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile
-
drawTileData
public byte[] drawTileData(short[] pixelValues, int tileWidth, int tileHeight) Draw a coverage data image tile and format as PNG bytes from the flat array of "unsigned short" pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x- Parameters:
pixelValues
- "unsigned short" pixel values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile bytes
-
drawTile
Draw a coverage data tile from the double array of "unsigned short" pixel values formatted as short[row][width]- Parameters:
pixelValues
- "unsigned short" pixel values as [row][width]- Returns:
- coverage data image tile
-
drawTileData
public byte[] drawTileData(short[][] pixelValues) Draw a coverage data tile and format as PNG bytes from the double array of "unsigned short" pixel values formatted as short[row][width]- Parameters:
pixelValues
- "unsigned short" pixel values as [row][width]- Returns:
- coverage data image tile bytes
-
drawTile
Draw a coverage data image tile from the flat array of unsigned 16 bit integer pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x- Parameters:
unsignedPixelValues
- unsigned 16 bit integer pixel values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile
-
drawTileData
public byte[] drawTileData(int[] unsignedPixelValues, int tileWidth, int tileHeight) Draw a coverage data image tile and format as PNG bytes from the flat array of unsigned 16 bit integer pixel values of length tileWidth * tileHeight where each pixel is at: (y * tileWidth) + x- Parameters:
unsignedPixelValues
- unsigned 16 bit integer pixel values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile bytes
-
drawTile
Draw a coverage data image tile from the double array of unsigned 16 bit integer pixel values formatted as int[row][width]- Parameters:
unsignedPixelValues
- unsigned 16 bit integer pixel values as [row][width]- Returns:
- coverage data image tile
-
drawTileData
public byte[] drawTileData(int[][] unsignedPixelValues) Draw a coverage data image tile and format as PNG bytes from the double array of unsigned 16 bit integer pixel values formatted as int[row][width]- Parameters:
unsignedPixelValues
- unsigned 16 bit integer pixel values as [row][width]- Returns:
- coverage data image tile bytes
-
drawTile
public CoverageDataPngImage 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 tilevalues
- coverage data values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile
-
drawTileData
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 classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tilevalues
- coverage data values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile bytes
-
drawTile
Draw a coverage data image tile from the double array of unsigned coverage data values formatted as Double[row][width]- Parameters:
griddedTile
- gridded tilevalues
- coverage data values as [row][width]- Returns:
- coverage data image tile
-
drawTileData
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 classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tilevalues
- coverage data values as [row][width]- Returns:
- coverage data image tile bytes
-
createImage
Create a new 16 bit single channel image- Parameters:
tileWidth
- tile widthtileHeight
- tile height- Returns:
- image
-
setPixelValue
Set the pixel value- Parameters:
row
- image line rowx
- x coordinatepixelValue
- pixel value
-
setPixelValue
public void setPixelValue(int[] row, int x, short pixelValue) Set the pixel value- Parameters:
row
- row arrayx
- x coordinatepixelValue
- pixel value
-
setPixelValue
Set the pixel value- Parameters:
row
- image line rowx
- x coordinateunsignedPixelValue
- unsigned pixel value
-
setPixelValue
public void setPixelValue(int[] row, int x, int unsignedPixelValue) Set the pixel value- Parameters:
row
- row arrayx
- x coordinateunsignedPixelValue
- unsigned pixel value
-
createTileTable
Create the coverage data tile table with metadata and extension- Parameters:
geoPackage
- GeoPackagemetadata
- tile table metadata- Returns:
- coverage data
- Since:
- 4.0.0
-