Class CoverageDataCore<TImage extends CoverageDataImage>
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.coverage.CoverageDataCore<TImage>
-
- Type Parameters:
TImage
- image type
public abstract class CoverageDataCore<TImage extends CoverageDataImage> extends BaseExtension
Tiled Gridded Coverage Core Data Extension- Since:
- 2.0.1
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected CoverageDataAlgorithm
algorithm
Interpolation algorithmprotected BoundingBox
coverageBoundingBox
Coverage data bounding boxprotected Projection
coverageProjection
Projection of the coverage dataprotected GriddedCoverageEncodingType
encoding
Value pixel encoding typestatic String
EXTENSION_AUTHOR
Extension authorstatic String
EXTENSION_DEFINITION
Extension definition URLstatic String
EXTENSION_NAME
Extension, with author and namestatic String
EXTENSION_NAME_NO_AUTHOR
Extension name without the authorstatic String
GRIDDED_COVERAGE
Contents Data Typeprotected Integer
height
Coverage data results heightprotected Projection
requestProjection
Projection of the requestsprotected boolean
sameProjection
Flag indicating the coverage data and request projections are the sameprotected Integer
width
Coverage data results widthprotected boolean
zoomIn
True if zooming in should be performed to find a tile matrix with coverage data valuesprotected boolean
zoomInBeforeOut
True if zoom in in before zooming out, false to zoom out firstprotected boolean
zoomOut
True if zooming out should be performed to find a tile matrix with coverage data values-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CoverageDataCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet)
Constructor for creating extension rows when creating a new coverage data tile tableprotected
CoverageDataCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet, Integer width, Integer height, Projection requestProjection)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
createGriddedCoverageTable()
Create the 2D Gridded Coverage Table if it does not existboolean
createGriddedTileTable()
Create the 2D Gridded Tile Table if it does not existstatic TileTable
createTileTable(GeoPackageCore geoPackage, TileTableMetadata metadata)
Create the coverage data tile tableprotected Double[][]
formatUnboundedResults(TileMatrix tileMatrix, Map<Long,Map<Long,Double[][]>> rowsMap, int tileCount, long minRow, long maxRow, long minColumn, long maxColumn)
Format the unbounded results from coverage data tiles into a single double array of coverage dataCoverageDataAlgorithm
getAlgorithm()
Get the interpolation algorithmprotected Double
getBicubicInterpolationValue(Double[][] values, float offsetX, float offsetY)
Get the bicubic interpolation coverage data value from the 4 x 4 coverage data valuesprotected Double
getBicubicInterpolationValue(Double[][] values, CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY)
Get the bicubic interpolation coverage data value from the 4 x 4 coverage data valuesprotected Double
getBicubicInterpolationValue(GriddedTile griddedTile, TImage image, Double[][] leftLastColumns, Double[][] topLeftRows, Double[][] topRows, int y, int x, float widthRatio, float heightRatio, float destTop, float destLeft, float srcTop, float srcLeft)
Get the bicubic interpolation coverage data valueprotected Double
getBilinearInterpolationValue(float offsetX, float offsetY, float minX, float maxX, float minY, float maxY, Double[][] values)
Get the Bilinear Interpolation coverage data valueprotected Double
getBilinearInterpolationValue(float offsetX, float offsetY, float minX, float maxX, float minY, float maxY, Double topLeft, Double topRight, Double bottomLeft, Double bottomRight)
Get the Bilinear Interpolation coverage data valueprotected Double
getBilinearInterpolationValue(CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY, Double[][] values)
Get the Bilinear Interpolation coverage data valueprotected Double
getBilinearInterpolationValue(GriddedTile griddedTile, TImage image, Double[][] leftLastColumns, Double[][] topLeftRows, Double[][] topRows, int y, int x, float widthRatio, float heightRatio, float destTop, float destLeft, float srcTop, float srcLeft)
Get the bilinear interpolation coverage data valueBoundingBox
getCoverageBoundingBox()
Get the coverage data bounding boxProjection
getCoverageProjection()
Get the coverage data projectionprotected Double
getCubicInterpolationValue(Double[] values, double offset)
Interpolate 4 values using the offset between value1 and value2protected Double
getCubicInterpolationValue(Double value0, Double value1, Double value2, Double value3, double offset)
Interpolate 4 values using the offset between value1 and value2Double
getDataNull()
Get the data null valueGriddedCoverageEncodingType
getEncoding()
Get the value pixel encoding typefloat
getFloatPixelValue(GriddedTile griddedTile, Double value)
Get the pixel value of the coverage data valueGriddedCoverage
getGriddedCoverage()
Get the gridded coverageGriddedCoverageDao
getGriddedCoverageDao()
Get a 2D Gridded Coverage DAOstatic GriddedCoverageDao
getGriddedCoverageDao(GeoPackageCoreConnection db)
Get a 2D Gridded Coverage DAOstatic GriddedCoverageDao
getGriddedCoverageDao(GeoPackageCore geoPackage)
Get a 2D Gridded Coverage DAOList<GriddedTile>
getGriddedTile()
Get the gridded tileGriddedTile
getGriddedTile(long tileId)
Get the gridded tile by idGriddedTileDao
getGriddedTileDao()
Get a 2D Gridded Tile DAOstatic GriddedTileDao
getGriddedTileDao(GeoPackageCoreConnection db)
Get a 2D Gridded Tile DAOstatic GriddedTileDao
getGriddedTileDao(GeoPackageCore geoPackage)
Get a 2D Gridded Tile DAOInteger
getHeight()
Get the requested coverage data heightprotected List<int[]>
getNearestNeighbors(float xSource, float ySource)
Determine the nearest neighbors of the source pixel, sorted by closest to farthest neighborprotected Double
getNearestNeighborValue(GriddedTile griddedTile, TImage image, Double[][] leftLastColumns, Double[][] topLeftRows, Double[][] topRows, int y, int x, float widthRatio, float heightRatio, float destTop, float destLeft, float srcTop, float srcLeft)
Get the nearest neighbor coverage data valueList<Extensions>
getOrCreate()
Get or create the extensionfloat
getPixelValue(float[] pixelValues, int width, int x, int y)
Get the pixel value at the coordinate from the pixel valuesshort
getPixelValue(int unsignedPixelValue)
Get the "unsigned short" value from the unsigned 16 bit integer pixel valueshort
getPixelValue(short[] pixelValues, int width, int x, int y)
Get the pixel value as an "unsigned short" at the coordinate from the "unsigned short" pixel valuesshort
getPixelValue(GriddedTile griddedTile, Double value)
Get the "unsigned short" pixel value of the coverage data valueProjection
getRequestProjection()
Get the request projectionstatic List<String>
getTables(GeoPackageCore geoPackage)
Get the coverage data tile tablesTileMatrixSet
getTileMatrixSet()
Get the Tile Matrix Setint
getUnsignedPixelValue(int[] unsignedPixelValues, int width, int x, int y)
Get the pixel value as a 16 bit unsigned value at the coordinate from the 16 bit unsigned pixel valuesint
getUnsignedPixelValue(short pixelValue)
Get the unsigned pixel value.int
getUnsignedPixelValue(short[] pixelValues, int width, int x, int y)
Get the pixel value as a 16 bit unsigned value as an integerint
getUnsignedPixelValue(GriddedTile griddedTile, Double value)
Get the unsigned 16 bit integer pixel value of the coverage data valueint[]
getUnsignedPixelValues(short[] pixelValues)
Get the unsigned pixel values.Double
getValue(double latitude, double longitude)
Get the coverage data value at the coordinateDouble
getValue(GriddedTile griddedTile, float pixelValue)
Get the coverage data value for the pixel valueDouble
getValue(GriddedTile griddedTile, int unsignedPixelValue)
Get the coverage data value for the unsigned short pixel valueDouble
getValue(GriddedTile griddedTile, short pixelValue)
Get the coverage data value for the "unsigned short" pixel valueabstract Double
getValue(GriddedTile griddedTile, TImage image, int x, int y)
Get the coverage data value from the image at the coordinateCoverageDataResults
getValues(BoundingBox requestBoundingBox)
Get the coverage data values within the bounding boxCoverageDataResults
getValues(BoundingBox requestBoundingBox, Integer width, Integer height)
Get the coverage data values within the bounding box with the requested width and height result sizeCoverageDataResults
getValues(CoverageDataRequest request)
Get the requested coverage data valuesabstract CoverageDataResults
getValues(CoverageDataRequest request, Integer width, Integer height)
Get the requested coverage data values with the requested width and heightDouble[]
getValues(GriddedTile griddedTile, float[] pixelValues)
Get the coverage data values from the pixel valuesDouble[]
getValues(GriddedTile griddedTile, int[] unsignedPixelValues)
Get the coverage data values from the "unsigned short" pixel valuesDouble[]
getValues(GriddedTile griddedTile, short[] pixelValues)
Get the coverage data values from the "unsigned short" pixel valuesCoverageDataResults
getValuesUnbounded(BoundingBox requestBoundingBox)
Get the unbounded coverage data values within the bounding box.abstract CoverageDataResults
getValuesUnbounded(CoverageDataRequest request)
Get the requested unbounded coverage data values.Integer
getWidth()
Get the requested coverage data widthprotected float
getXSource(int x, float destLeft, float srcLeft, float widthRatio)
Determine the x source pixel locationprotected CoverageDataSourcePixel
getXSourceMinAndMax(float source)
Get the min, max, and offset of the source X pixelprotected float
getYSource(int y, float destTop, float srcTop, float heightRatio)
Determine the y source pixel locationprotected CoverageDataSourcePixel
getYSourceMinAndMax(float source)
Get the min, max, and offset of the source Y pixelboolean
has()
Determine if the Tile Matrix Set has the extensionboolean
isDataNull(double value)
Check the pixel value to see if it is the null equivalentboolean
isSameProjection()
Is the request and coverage data projection the sameboolean
isZoomIn()
Is the zooming in (higher zoom level values) enabled to find matching coverage databoolean
isZoomInBeforeOut()
Is zooming in (when enabled) performed before zooming out (when enabled)boolean
isZoomOut()
Is the zooming out (lower zoom level values) enabled to find matching coverage dataprotected BoundingBox
padBoundingBox(TileMatrix tileMatrix, BoundingBox boundingBox, int overlap)
Pad the bounding box with extra space for the overlapping pixelsGriddedCoverage
queryGriddedCoverage()
Query and update the gridded coverageprotected Double[][]
reprojectCoverageData(Double[][] values, int requestedCoverageWidth, int requestedCoverageHeight, BoundingBox requestBoundingBox, ProjectionTransform transformRequestToCoverage, BoundingBox coverageBoundingBox)
Reproject the coverage data to the requested projectionvoid
setAlgorithm(CoverageDataAlgorithm algorithm)
Set the interpolation algorithmvoid
setEncoding(GriddedCoverageEncodingType encoding)
Set the value pixel encoding typevoid
setHeight(Integer height)
Set the requested coverage data heightvoid
setWidth(Integer width)
Set the requested coverage data widthvoid
setZoomIn(boolean zoomIn)
Set the zoom in enabled statevoid
setZoomInBeforeOut(boolean zoomInBeforeOut)
Set the zoom order between in and outvoid
setZoomOut(boolean zoomOut)
Set the zoom out enabled state-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, has, has, verifyWritable
-
-
-
-
Field Detail
-
EXTENSION_AUTHOR
public static final String EXTENSION_AUTHOR
Extension author- See Also:
- Constant Field Values
-
EXTENSION_NAME_NO_AUTHOR
public static final String EXTENSION_NAME_NO_AUTHOR
Extension name without the author- See Also:
- Constant Field Values
-
EXTENSION_NAME
public static final String EXTENSION_NAME
Extension, with author and name
-
EXTENSION_DEFINITION
public static final String EXTENSION_DEFINITION
Extension definition URL
-
GRIDDED_COVERAGE
public static final String GRIDDED_COVERAGE
Contents Data Type- Since:
- 4.0.0
- See Also:
- Constant Field Values
-
width
protected Integer width
Coverage data results width
-
height
protected Integer height
Coverage data results height
-
requestProjection
protected final Projection requestProjection
Projection of the requests
-
coverageProjection
protected final Projection coverageProjection
Projection of the coverage data
-
coverageBoundingBox
protected final BoundingBox coverageBoundingBox
Coverage data bounding box
-
sameProjection
protected final boolean sameProjection
Flag indicating the coverage data and request projections are the same
-
zoomIn
protected boolean zoomIn
True if zooming in should be performed to find a tile matrix with coverage data values
-
zoomOut
protected boolean zoomOut
True if zooming out should be performed to find a tile matrix with coverage data values
-
zoomInBeforeOut
protected boolean zoomInBeforeOut
True if zoom in in before zooming out, false to zoom out first
-
algorithm
protected CoverageDataAlgorithm algorithm
Interpolation algorithm
-
encoding
protected GriddedCoverageEncodingType encoding
Value pixel encoding type
-
-
Constructor Detail
-
CoverageDataCore
protected CoverageDataCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet, Integer width, Integer height, Projection requestProjection)
Constructor- Parameters:
geoPackage
- GeoPackagetileMatrixSet
- tile matrix setwidth
- specified results widthheight
- specified results heightrequestProjection
- request projection
-
CoverageDataCore
protected CoverageDataCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet)
Constructor for creating extension rows when creating a new coverage data tile table- Parameters:
geoPackage
- GeoPackagetileMatrixSet
- tile matrix set
-
-
Method Detail
-
getValue
public abstract Double getValue(GriddedTile griddedTile, TImage image, int x, int y)
Get the coverage data value from the image at the coordinate- Parameters:
griddedTile
- gridded tileimage
- coverage data imagex
- x coordinatey
- y coordinate- Returns:
- coverage data value
-
getValues
public abstract CoverageDataResults getValues(CoverageDataRequest request, Integer width, Integer height)
Get the requested coverage data values with the requested width and height- Parameters:
request
- coverage data requestwidth
- coverage data request widthheight
- coverage data request height- Returns:
- coverage data results
-
getValuesUnbounded
public abstract CoverageDataResults getValuesUnbounded(CoverageDataRequest request)
Get the requested unbounded coverage data values. Unbounded results retrieves and returns each coverage data pixel. The results size equals the width and height of all matching pixels.- Parameters:
request
- coverage data request- Returns:
- coverage data results
-
getTileMatrixSet
public TileMatrixSet getTileMatrixSet()
Get the Tile Matrix Set- Returns:
- Tile Matrix Set
-
getWidth
public Integer getWidth()
Get the requested coverage data width- Returns:
- width
-
setWidth
public void setWidth(Integer width)
Set the requested coverage data width- Parameters:
width
- requested coverage data width
-
getHeight
public Integer getHeight()
Get the requested coverage data height- Returns:
- height
-
setHeight
public void setHeight(Integer height)
Set the requested coverage data height- Parameters:
height
- requested coverage data height
-
getRequestProjection
public Projection getRequestProjection()
Get the request projection- Returns:
- request projection
-
getCoverageProjection
public Projection getCoverageProjection()
Get the coverage data projection- Returns:
- coverage data projection
-
getCoverageBoundingBox
public BoundingBox getCoverageBoundingBox()
Get the coverage data bounding box- Returns:
- coverage data bounding box
-
isSameProjection
public boolean isSameProjection()
Is the request and coverage data projection the same- Returns:
- true if the same
-
isZoomIn
public boolean isZoomIn()
Is the zooming in (higher zoom level values) enabled to find matching coverage data- Returns:
- true if zoom in enabled
-
setZoomIn
public void setZoomIn(boolean zoomIn)
Set the zoom in enabled state- Parameters:
zoomIn
- true to zoom in when finding coverage data, false to disable
-
isZoomOut
public boolean isZoomOut()
Is the zooming out (lower zoom level values) enabled to find matching coverage data- Returns:
- true if zoom out enabled
-
setZoomOut
public void setZoomOut(boolean zoomOut)
Set the zoom out enabled state- Parameters:
zoomOut
- true to zoom out when finding coverage data, false to disable
-
isZoomInBeforeOut
public boolean isZoomInBeforeOut()
Is zooming in (when enabled) performed before zooming out (when enabled)- Returns:
- true to zoom in for results first, false to zoom out for results first
-
setZoomInBeforeOut
public void setZoomInBeforeOut(boolean zoomInBeforeOut)
Set the zoom order between in and out- Parameters:
zoomInBeforeOut
- true to zoom in for results first, false to zoom out first
-
getAlgorithm
public CoverageDataAlgorithm getAlgorithm()
Get the interpolation algorithm- Returns:
- algorithm
-
setAlgorithm
public void setAlgorithm(CoverageDataAlgorithm algorithm)
Set the interpolation algorithm- Parameters:
algorithm
- algorithm type
-
getEncoding
public GriddedCoverageEncodingType getEncoding()
Get the value pixel encoding type- Returns:
- encoding type
- Since:
- 2.0.1
-
setEncoding
public void setEncoding(GriddedCoverageEncodingType encoding)
Set the value pixel encoding type- Parameters:
encoding
- encoding type- Since:
- 2.0.1
-
getOrCreate
public List<Extensions> getOrCreate()
Get or create the extension- Returns:
- extensions list
-
has
public boolean has()
Determine if the Tile Matrix Set has the extension- Returns:
- true if has extension
-
getGriddedCoverageDao
public GriddedCoverageDao getGriddedCoverageDao()
Get a 2D Gridded Coverage DAO- Returns:
- 2d gridded coverage dao
-
getGriddedCoverageDao
public static GriddedCoverageDao getGriddedCoverageDao(GeoPackageCore geoPackage)
Get a 2D Gridded Coverage DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- 2d gridded coverage dao
- Since:
- 4.0.0
-
getGriddedCoverageDao
public static GriddedCoverageDao getGriddedCoverageDao(GeoPackageCoreConnection db)
Get a 2D Gridded Coverage DAO- Parameters:
db
- database connection- Returns:
- 2d gridded coverage dao
- Since:
- 4.0.0
-
createGriddedCoverageTable
public boolean createGriddedCoverageTable()
Create the 2D Gridded Coverage Table if it does not exist- Returns:
- true if created
- Since:
- 4.0.0
-
getGriddedTileDao
public GriddedTileDao getGriddedTileDao()
Get a 2D Gridded Tile DAO- Returns:
- 2d gridded tile dao
-
getGriddedTileDao
public static GriddedTileDao getGriddedTileDao(GeoPackageCore geoPackage)
Get a 2D Gridded Tile DAO- Parameters:
geoPackage
- GeoPackage- Returns:
- 2d gridded tile dao
- Since:
- 4.0.0
-
getGriddedTileDao
public static GriddedTileDao getGriddedTileDao(GeoPackageCoreConnection db)
Get a 2D Gridded Tile DAO- Parameters:
db
- database connection- Returns:
- 2d gridded tile dao
- Since:
- 4.0.0
-
createGriddedTileTable
public boolean createGriddedTileTable()
Create the 2D Gridded Tile Table if it does not exist- Returns:
- true if created
- Since:
- 4.0.0
-
getGriddedCoverage
public GriddedCoverage getGriddedCoverage()
Get the gridded coverage- Returns:
- gridded coverage
-
queryGriddedCoverage
public GriddedCoverage queryGriddedCoverage()
Query and update the gridded coverage- Returns:
- gridded coverage
-
getGriddedTile
public List<GriddedTile> getGriddedTile()
Get the gridded tile- Returns:
- gridded tiles
-
getGriddedTile
public GriddedTile getGriddedTile(long tileId)
Get the gridded tile by id- Parameters:
tileId
- tile id- Returns:
- gridded tile
-
getDataNull
public Double getDataNull()
Get the data null value- Returns:
- data null value or null
-
isDataNull
public boolean isDataNull(double value)
Check the pixel value to see if it is the null equivalent- Parameters:
value
- pixel value- Returns:
- true if equivalent to data null
-
getTables
public static List<String> getTables(GeoPackageCore geoPackage)
Get the coverage data tile tables- Parameters:
geoPackage
- GeoPackage- Returns:
- table names
-
reprojectCoverageData
protected Double[][] reprojectCoverageData(Double[][] values, int requestedCoverageWidth, int requestedCoverageHeight, BoundingBox requestBoundingBox, ProjectionTransform transformRequestToCoverage, BoundingBox coverageBoundingBox)
Reproject the coverage data to the requested projection- Parameters:
values
- coverage data valuesrequestedCoverageWidth
- requested coverage data widthrequestedCoverageHeight
- requested coverage data heightrequestBoundingBox
- request bounding box in the request projectiontransformRequestToCoverage
- transformation from request to coverage datacoverageBoundingBox
- coverage data bounding box- Returns:
- projected coverage data
-
formatUnboundedResults
protected Double[][] formatUnboundedResults(TileMatrix tileMatrix, Map<Long,Map<Long,Double[][]>> rowsMap, int tileCount, long minRow, long maxRow, long minColumn, long maxColumn)
Format the unbounded results from coverage data tiles into a single double array of coverage data- Parameters:
tileMatrix
- tile matrixrowsMap
- rows maptileCount
- tile countminRow
- min rowmaxRow
- max rowminColumn
- min columnmaxColumn
- max column- Returns:
- coverage data
-
getXSource
protected float getXSource(int x, float destLeft, float srcLeft, float widthRatio)
Determine the x source pixel location- Parameters:
x
- x pixeldestLeft
- destination left most pixelsrcLeft
- source left most pixelwidthRatio
- source over destination width ratio- Returns:
- x source pixel
-
getYSource
protected float getYSource(int y, float destTop, float srcTop, float heightRatio)
Determine the y source pixel location- Parameters:
y
- y pixeldestTop
- destination top most pixelsrcTop
- source top most pixelheightRatio
- source over destination height ratio- Returns:
- y source pixel
-
getNearestNeighbors
protected List<int[]> getNearestNeighbors(float xSource, float ySource)
Determine the nearest neighbors of the source pixel, sorted by closest to farthest neighbor- Parameters:
xSource
- x source pixelySource
- y source pixel- Returns:
- nearest neighbor pixels
-
getXSourceMinAndMax
protected CoverageDataSourcePixel getXSourceMinAndMax(float source)
Get the min, max, and offset of the source X pixel- Parameters:
source
- source x pixel- Returns:
- source x pixel information
-
getYSourceMinAndMax
protected CoverageDataSourcePixel getYSourceMinAndMax(float source)
Get the min, max, and offset of the source Y pixel- Parameters:
source
- source y pixel- Returns:
- source y pixel information
-
getBilinearInterpolationValue
protected Double getBilinearInterpolationValue(CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY, Double[][] values)
Get the Bilinear Interpolation coverage data value- Parameters:
sourcePixelX
- source pixel xsourcePixelY
- source pixel yvalues
- 2 x 2 coverage data values as [y][x]- Returns:
- coverage data value
-
getBilinearInterpolationValue
protected Double getBilinearInterpolationValue(float offsetX, float offsetY, float minX, float maxX, float minY, float maxY, Double[][] values)
Get the Bilinear Interpolation coverage data value- Parameters:
offsetX
- x source pixel offsetoffsetY
- y source pixel offsetminX
- min x valuemaxX
- max x valueminY
- min y valuemaxY
- max y valuevalues
- 2 x 2 coverage data values as [y][x]- Returns:
- coverage data value
-
getBilinearInterpolationValue
protected Double getBilinearInterpolationValue(float offsetX, float offsetY, float minX, float maxX, float minY, float maxY, Double topLeft, Double topRight, Double bottomLeft, Double bottomRight)
Get the Bilinear Interpolation coverage data value- Parameters:
offsetX
- x source pixel offsetoffsetY
- y source pixel offsetminX
- min x valuemaxX
- max x valueminY
- min y valuemaxY
- max y valuetopLeft
- top left coverage valuetopRight
- top right coverage valuebottomLeft
- bottom left coverage valuebottomRight
- bottom right coverage value- Returns:
- coverage data value
-
getBicubicInterpolationValue
protected Double getBicubicInterpolationValue(Double[][] values, CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY)
Get the bicubic interpolation coverage data value from the 4 x 4 coverage data values- Parameters:
values
- coverage data valuessourcePixelX
- source pixel xsourcePixelY
- source pixel y- Returns:
- bicubic coverage data value
-
getBicubicInterpolationValue
protected Double getBicubicInterpolationValue(Double[][] values, float offsetX, float offsetY)
Get the bicubic interpolation coverage data value from the 4 x 4 coverage data values- Parameters:
values
- coverage data valuesoffsetX
- x source pixel offsetoffsetY
- y source pixel offset- Returns:
- bicubic coverage data value
-
getCubicInterpolationValue
protected Double getCubicInterpolationValue(Double[] values, double offset)
Interpolate 4 values using the offset between value1 and value2- Parameters:
values
- coverage data valuesoffset
- offset between the middle two pixels- Returns:
- value coverage data value
-
getCubicInterpolationValue
protected Double getCubicInterpolationValue(Double value0, Double value1, Double value2, Double value3, double offset)
Interpolate 4 values using the offset between value1 and value2- Parameters:
value0
- index 0 valuevalue1
- index 1 valuevalue2
- index 2 valuevalue3
- index 3 valueoffset
- offset between the middle two pixels- Returns:
- value coverage data value
-
padBoundingBox
protected BoundingBox padBoundingBox(TileMatrix tileMatrix, BoundingBox boundingBox, int overlap)
Pad the bounding box with extra space for the overlapping pixels- Parameters:
tileMatrix
- tile matrixboundingBox
- bounding boxoverlap
- overlapping pixels- Returns:
- padded bounding box
-
getPixelValue
public short getPixelValue(short[] pixelValues, int width, int x, int y)
Get the pixel value as an "unsigned short" at the coordinate from the "unsigned short" pixel values- Parameters:
pixelValues
- "unsigned short" pixel valueswidth
- image widthx
- x coordinatey
- y coordinate- Returns:
- "unsigned short" pixel value
-
getUnsignedPixelValue
public int getUnsignedPixelValue(short[] pixelValues, int width, int x, int y)
Get the pixel value as a 16 bit unsigned value as an integer- Parameters:
pixelValues
- "unsigned short" pixel valueswidth
- image widthx
- x coordinatey
- y coordinate- Returns:
- unsigned int pixel value
-
getUnsignedPixelValue
public int getUnsignedPixelValue(int[] unsignedPixelValues, int width, int x, int y)
Get the pixel value as a 16 bit unsigned value at the coordinate from the 16 bit unsigned pixel values- Parameters:
unsignedPixelValues
- unsigned int pixel valueswidth
- image widthx
- x coordinatey
- y coordinate- Returns:
- 16 bit unsigned pixel value
-
getUnsignedPixelValue
public int getUnsignedPixelValue(short pixelValue)
Get the unsigned pixel value. The value saved as an "unsigned short" in the short is returned as an integer which stores the positive 16 bit value- Parameters:
pixelValue
- "unsigned short" pixel value- Returns:
- unsigned 16 bit pixel value as an integer
-
getPixelValue
public short getPixelValue(int unsignedPixelValue)
Get the "unsigned short" value from the unsigned 16 bit integer pixel value- Parameters:
unsignedPixelValue
- unsigned 16 bit integer pixel value- Returns:
- "unsigned short" pixel value
-
getUnsignedPixelValues
public int[] getUnsignedPixelValues(short[] pixelValues)
Get the unsigned pixel values. The values saved as "unsigned shorts" in the short array is returned as an integer which stores the positive 16 bit value- Parameters:
pixelValues
- pixel values as "unsigned shorts"- Returns:
- unsigned 16 bit pixel values as an integer array
-
getValue
public Double getValue(GriddedTile griddedTile, short pixelValue)
Get the coverage data value for the "unsigned short" pixel value- Parameters:
griddedTile
- gridded tilepixelValue
- pixel value as an unsigned short- Returns:
- coverage data value
-
getValue
public Double getValue(GriddedTile griddedTile, int unsignedPixelValue)
Get the coverage data value for the unsigned short pixel value- Parameters:
griddedTile
- gridded tileunsignedPixelValue
- pixel value as an unsigned 16 bit integer- Returns:
- coverage data value
-
getValues
public Double[] getValues(GriddedTile griddedTile, short[] pixelValues)
Get the coverage data values from the "unsigned short" pixel values- Parameters:
griddedTile
- gridded tilepixelValues
- pixel values as "unsigned shorts"- Returns:
- coverage data values
-
getValues
public Double[] getValues(GriddedTile griddedTile, int[] unsignedPixelValues)
Get the coverage data values from the "unsigned short" pixel values- Parameters:
griddedTile
- gridded tileunsignedPixelValues
- pixel values as 16 bit integers- Returns:
- coverage data values
-
createTileTable
public static TileTable createTileTable(GeoPackageCore geoPackage, TileTableMetadata metadata)
Create the coverage data tile table- Parameters:
geoPackage
- GeoPackagemetadata
- tile table metadata- Returns:
- tile table
- Since:
- 4.0.0
-
getUnsignedPixelValue
public int getUnsignedPixelValue(GriddedTile griddedTile, Double value)
Get the unsigned 16 bit integer pixel value of the coverage data value- Parameters:
griddedTile
- gridded tilevalue
- coverage data value- Returns:
- 16 bit integer pixel value
-
getPixelValue
public short getPixelValue(GriddedTile griddedTile, Double value)
Get the "unsigned short" pixel value of the coverage data value- Parameters:
griddedTile
- gridded tilevalue
- coverage data value- Returns:
- "unsigned short" pixel value
-
getPixelValue
public float getPixelValue(float[] pixelValues, int width, int x, int y)
Get the pixel value at the coordinate from the pixel values- Parameters:
pixelValues
- pixel valueswidth
- image widthx
- x coordinatey
- y coordinate- Returns:
- pixel value
-
getValue
public Double getValue(GriddedTile griddedTile, float pixelValue)
Get the coverage data value for the pixel value- Parameters:
griddedTile
- gridded tilepixelValue
- pixel value- Returns:
- coverage data value
-
getValues
public Double[] getValues(GriddedTile griddedTile, float[] pixelValues)
Get the coverage data values from the pixel values- Parameters:
griddedTile
- gridded tilepixelValues
- pixel values- Returns:
- coverage data values
-
getFloatPixelValue
public float getFloatPixelValue(GriddedTile griddedTile, Double value)
Get the pixel value of the coverage data value- Parameters:
griddedTile
- gridded tilevalue
- coverage data value- Returns:
- pixel value
-
getValue
public Double getValue(double latitude, double longitude)
Get the coverage data value at the coordinate- Parameters:
latitude
- latitudelongitude
- longitude- Returns:
- coverage data value
-
getValues
public CoverageDataResults getValues(BoundingBox requestBoundingBox)
Get the coverage data values within the bounding box- Parameters:
requestBoundingBox
- request bounding box- Returns:
- coverage data results
-
getValues
public CoverageDataResults getValues(BoundingBox requestBoundingBox, Integer width, Integer height)
Get the coverage data values within the bounding box with the requested width and height result size- Parameters:
requestBoundingBox
- request bounding boxwidth
- coverage data request widthheight
- coverage data request height- Returns:
- coverage data results
-
getValues
public CoverageDataResults getValues(CoverageDataRequest request)
Get the requested coverage data values- Parameters:
request
- coverage data request- Returns:
- coverage data results
-
getValuesUnbounded
public CoverageDataResults getValuesUnbounded(BoundingBox requestBoundingBox)
Get the unbounded coverage data values within the bounding box. Unbounded results retrieves and returns each coverage data pixel. The results size equals the width and height of all matching pixels.- Parameters:
requestBoundingBox
- request bounding box- Returns:
- coverage data results
-
getBilinearInterpolationValue
protected Double getBilinearInterpolationValue(GriddedTile griddedTile, TImage image, Double[][] leftLastColumns, Double[][] topLeftRows, Double[][] topRows, int y, int x, float widthRatio, float heightRatio, float destTop, float destLeft, float srcTop, float srcLeft)
Get the bilinear interpolation coverage data value- Parameters:
griddedTile
- gridded tileimage
- imageleftLastColumns
- last columns in the tile to the lefttopLeftRows
- last rows of the tile to the top lefttopRows
- last rows of the tile to the topy
- y coordinatex
- x coordinatewidthRatio
- width source over destination ratioheightRatio
- height source over destination ratiodestTop
- destination top most pixeldestLeft
- destination left most pixelsrcTop
- source top most pixelsrcLeft
- source left most pixel- Returns:
- bilinear coverage data value
-
getBicubicInterpolationValue
protected Double getBicubicInterpolationValue(GriddedTile griddedTile, TImage image, Double[][] leftLastColumns, Double[][] topLeftRows, Double[][] topRows, int y, int x, float widthRatio, float heightRatio, float destTop, float destLeft, float srcTop, float srcLeft)
Get the bicubic interpolation coverage data value- Parameters:
griddedTile
- gridded tileimage
- imageleftLastColumns
- last columns in the tile to the lefttopLeftRows
- last rows of the tile to the top lefttopRows
- last rows of the tile to the topy
- y coordinatex
- x coordinatewidthRatio
- width source over destination ratioheightRatio
- height source over destination ratiodestTop
- destination top most pixeldestLeft
- destination left most pixelsrcTop
- source top most pixelsrcLeft
- source left most pixel- Returns:
- bicubic coverage data value
-
getNearestNeighborValue
protected Double getNearestNeighborValue(GriddedTile griddedTile, TImage image, Double[][] leftLastColumns, Double[][] topLeftRows, Double[][] topRows, int y, int x, float widthRatio, float heightRatio, float destTop, float destLeft, float srcTop, float srcLeft)
Get the nearest neighbor coverage data value- Parameters:
griddedTile
- gridded tileimage
- imageleftLastColumns
- last columns in the tile to the lefttopLeftRows
- last rows of the tile to the top lefttopRows
- last rows of the tile to the topy
- y coordinatex
- x coordinatewidthRatio
- width source over destination ratioheightRatio
- height source over destination ratiodestTop
- destination top most pixeldestLeft
- destination left most pixelsrcTop
- source top most pixelsrcLeft
- source left most pixel- Returns:
- nearest neighbor coverage data value
-
-