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
-
public class CoverageDataPng extends CoverageData<CoverageDataPngImage>
Tiled Gridded Coverage Data, PNG Encoding, Extension- Since:
- 2.0.1
- Author:
- osbornb
-
-
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
Constructors Constructor Description CoverageDataPng(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BufferedImage
createImage(int tileWidth, int tileHeight)
Create a new unsigned 16 bit short grayscale imageCoverageDataPngImage
createImage(TileRow tileRow)
Create a coverage data imagestatic CoverageDataPng
createTileTable(GeoPackage geoPackage, TileTableMetadata metadata)
Create the coverage data tile table with metadata and extensionBufferedImage
drawTile(int[][] unsignedPixelValues)
Draw a coverage data image tile from the double array of unsigned 16 bit integer pixel values formatted as int[row][width]BufferedImage
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) + xBufferedImage
drawTile(short[][] pixelValues)
Draw a coverage data tile from the double array of "unsigned short" pixel values formatted as short[row][width]BufferedImage
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) + xBufferedImage
drawTile(GriddedTile griddedTile, Double[][] values)
Draw a coverage data image tile from the double array of unsigned coverage data values formatted as Double[row][width]BufferedImage
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 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) + xbyte[]
getImageBytes(BufferedImage image)
Get the image as PNG bytesshort
getPixelValue(BufferedImage image, int x, int y)
Get the pixel value as an "unsigned short"short
getPixelValue(WritableRaster raster, int x, int y)
Get the pixel value as an "unsigned short" from the raster and the coordinateshort[]
getPixelValues(BufferedImage image)
Get the pixel values of the buffered image as "unsigned shorts"short[]
getPixelValues(WritableRaster raster)
Get the pixel values of the raster as "unsigned shorts"int
getUnsignedPixelValue(BufferedImage image, int x, int y)
Get the pixel value as a 16 bit unsigned integer valueint
getUnsignedPixelValue(WritableRaster raster, int x, int y)
Get the pixel value as a 16 bit unsigned integer valueint[]
getUnsignedPixelValues(BufferedImage image)
Get the pixel values of the buffered image as 16 bit unsigned integer valuesint[]
getUnsignedPixelValues(WritableRaster raster)
Get the pixel values of the raster as 16 bit unsigned integer valuesDouble
getValue(GriddedTile griddedTile, byte[] imageBytes, int x, int y)
Get the coverage data valueDouble
getValue(GriddedTile griddedTile, BufferedImage image, int x, int y)
Get the coverage data valueDouble
getValue(GriddedTile griddedTile, WritableRaster raster, int x, int y)
Get the coverage data valueDouble
getValue(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 valuesDouble[]
getValues(GriddedTile griddedTile, BufferedImage image)
Get the coverage data valuesDouble[]
getValues(GriddedTile griddedTile, WritableRaster raster)
Get the coverage data valuesvoid
setPixelValue(WritableRaster raster, int x, int y, int unsignedPixelValue)
Set the unsigned 16 bit integer pixel value into the image rastervoid
setPixelValue(WritableRaster raster, int x, int y, short pixelValue)
Set the "unsigned short" pixel value into the image rastervoid
validateImageType(BufferedImage image)
Validate that the image type is an unsigned short-
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
-
-
-
-
Constructor Detail
-
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
public CoverageDataPng(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
-
CoverageDataPng
public CoverageDataPng(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 CoverageDataPngImage createImage(TileRow tileRow)
Create a coverage data image- Specified by:
createImage
in classCoverageData<CoverageDataPngImage>
- 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 classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tiletileRow
- tile rowx
- x coordinatey
- y coordinate- Returns:
- coverage data value
-
getValue
public Double getValue(GriddedTile griddedTile, CoverageDataPngImage image, int x, int y)
- Specified by:
getValue
in classCoverageDataCore<CoverageDataPngImage>
-
getPixelValue
public short getPixelValue(BufferedImage image, int x, int y)
Get the pixel value as an "unsigned short"- Parameters:
image
- tile imagex
- x coordinatey
- y coordinate- Returns:
- "unsigned short" pixel value
-
getUnsignedPixelValue
public int getUnsignedPixelValue(BufferedImage image, int x, int y)
Get the pixel value as a 16 bit unsigned integer value- Parameters:
image
- tile imagex
- x coordinatey
- y coordinate- Returns:
- unsigned integer pixel value
-
getPixelValue
public short getPixelValue(WritableRaster raster, int x, int y)
Get the pixel value as an "unsigned short" from the raster and the coordinate- Parameters:
raster
- image rasterx
- x coordinatey
- y coordinate- Returns:
- "unsigned short" pixel value
-
getUnsignedPixelValue
public int getUnsignedPixelValue(WritableRaster raster, int x, int y)
Get the pixel value as a 16 bit unsigned integer value- Parameters:
raster
- image rasterx
- x coordinatey
- y coordinate- Returns:
- unsigned integer pixel value
-
getPixelValues
public short[] getPixelValues(BufferedImage image)
Get the pixel values of the buffered image as "unsigned shorts"- Parameters:
image
- tile image- Returns:
- "unsigned short" pixel values
-
getUnsignedPixelValues
public int[] getUnsignedPixelValues(BufferedImage image)
Get the pixel values of the buffered image as 16 bit unsigned integer values- Parameters:
image
- tile image- Returns:
- unsigned integer pixel values
-
getPixelValues
public short[] getPixelValues(WritableRaster raster)
Get the pixel values of the raster as "unsigned shorts"- Parameters:
raster
- image raster- Returns:
- "unsigned short" pixel values
-
getUnsignedPixelValues
public int[] getUnsignedPixelValues(WritableRaster raster)
Get the pixel values of the raster as 16 bit unsigned integer values- Parameters:
raster
- image raster- Returns:
- unsigned integer pixel values
-
validateImageType
public void validateImageType(BufferedImage image)
Validate that the image type is an unsigned short- Parameters:
image
- tile image
-
getValue
public Double getValue(GriddedTile griddedTile, byte[] imageBytes, int x, int y)
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
-
getValue
public Double getValue(GriddedTile griddedTile, BufferedImage image, int x, int y)
Get the coverage data value- Parameters:
griddedTile
- gridded tileimage
- tile imagex
- x coordinatey
- y coordinate- Returns:
- coverage data value
-
getValue
public Double getValue(GriddedTile griddedTile, WritableRaster raster, int x, int y)
Get the coverage data value- Parameters:
griddedTile
- gridded tileraster
- image rasterx
- x coordinatey
- y coordinate- Returns:
- coverage data value
-
getValues
public Double[] getValues(GriddedTile griddedTile, byte[] imageBytes)
Get the coverage data values- Specified by:
getValues
in classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tileimageBytes
- image bytes- Returns:
- coverage data values
-
getValues
public Double[] getValues(GriddedTile griddedTile, BufferedImage image)
Get the coverage data values- Parameters:
griddedTile
- gridded tileimage
- tile image- Returns:
- coverage data values
-
getValues
public Double[] getValues(GriddedTile griddedTile, WritableRaster raster)
Get the coverage data values- Parameters:
griddedTile
- gridded tileraster
- raster image- Returns:
- coverage data values
-
drawTile
public BufferedImage 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) + 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
public BufferedImage drawTile(short[][] pixelValues)
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
public BufferedImage 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) + 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
public BufferedImage drawTile(int[][] unsignedPixelValues)
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 BufferedImage 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
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 classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tilevalues
- coverage data values of length tileWidth * tileHeighttileWidth
- tile widthtileHeight
- tile height- Returns:
- coverage data image tile bytes
-
drawTile
public BufferedImage drawTile(GriddedTile griddedTile, Double[][] values)
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
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 classCoverageData<CoverageDataPngImage>
- Parameters:
griddedTile
- gridded tilevalues
- coverage data values as [row][width]- Returns:
- coverage data image tile bytes
-
createImage
public BufferedImage createImage(int tileWidth, int tileHeight)
Create a new unsigned 16 bit short grayscale image- Parameters:
tileWidth
- tile widthtileHeight
- tile height- Returns:
- image
-
getImageBytes
public byte[] getImageBytes(BufferedImage image)
Get the image as PNG bytes- Parameters:
image
- buffered image- Returns:
- image bytes
-
setPixelValue
public void setPixelValue(WritableRaster raster, int x, int y, short pixelValue)
Set the "unsigned short" pixel value into the image raster- Parameters:
raster
- image rasterx
- x coordinatey
- y coordinatepixelValue
- "unsigned short" pixel value
-
setPixelValue
public void setPixelValue(WritableRaster raster, int x, int y, int unsignedPixelValue)
Set the unsigned 16 bit integer pixel value into the image raster- Parameters:
raster
- image rasterx
- x coordinatey
- y coordinateunsignedPixelValue
- unsigned 16 bit integer pixel value
-
createTileTable
public static CoverageDataPng 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
-
-