TImage - image typepublic abstract class CoverageDataCore<TImage extends CoverageDataImage> extends BaseExtension
| Modifier and Type | Field and Description |
|---|---|
protected CoverageDataAlgorithm |
algorithm
Interpolation algorithm
|
protected BoundingBox |
coverageBoundingBox
Coverage data bounding box
|
protected Projection |
coverageProjection
Projection of the coverage data
|
protected GriddedCoverageEncodingType |
encoding
Value pixel encoding type
|
static String |
EXTENSION_AUTHOR
Extension author
|
static String |
EXTENSION_DEFINITION
Extension definition URL
|
static String |
EXTENSION_NAME
Extension, with author and name
|
static String |
EXTENSION_NAME_NO_AUTHOR
Extension name without the author
|
protected Integer |
height
Coverage data results height
|
protected Projection |
requestProjection
Projection of the requests
|
protected boolean |
sameProjection
Flag indicating the coverage data and request projections are the same
|
protected Integer |
width
Coverage data results width
|
protected boolean |
zoomIn
True if zooming in should be performed to find a tile matrix with
coverage data values
|
protected boolean |
zoomInBeforeOut
True if zoom in in before zooming out, false to zoom out first
|
protected boolean |
zoomOut
True if zooming out should be performed to find a tile matrix with
coverage data values
|
extensionsDao, geoPackage| Modifier | Constructor and Description |
|---|---|
protected |
CoverageDataCore(GeoPackageCore geoPackage,
TileMatrixSet tileMatrixSet)
Constructor for creating extension rows when creating a new coverage data
tile table
|
protected |
CoverageDataCore(GeoPackageCore geoPackage,
TileMatrixSet tileMatrixSet,
Integer width,
Integer height,
Projection requestProjection)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
static TileMatrixSet |
createTileTableWithMetadata(GeoPackageCore geoPackage,
String tableName,
BoundingBox contentsBoundingBox,
long contentsSrsId,
BoundingBox tileMatrixSetBoundingBox,
long tileMatrixSetSrsId)
Create the coverage data tile table with metadata
|
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
|
CoverageDataAlgorithm |
getAlgorithm()
Get the interpolation algorithm
|
protected Double |
getBicubicInterpolationValue(Double[][] values,
CoverageDataSourcePixel sourcePixelX,
CoverageDataSourcePixel sourcePixelY)
Get the bicubic interpolation coverage data value from the 4 x 4 coverage
data values
|
protected Double |
getBicubicInterpolationValue(Double[][] values,
float offsetX,
float offsetY)
Get the bicubic interpolation coverage data value from the 4 x 4 coverage
data values
|
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
|
protected Double |
getBilinearInterpolationValue(CoverageDataSourcePixel sourcePixelX,
CoverageDataSourcePixel sourcePixelY,
Double[][] values)
Get the Bilinear Interpolation coverage data value
|
protected Double |
getBilinearInterpolationValue(float offsetX,
float offsetY,
float minX,
float maxX,
float minY,
float maxY,
Double[][] values)
Get the Bilinear Interpolation coverage data value
|
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
|
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
|
BoundingBox |
getCoverageBoundingBox()
Get the coverage data bounding box
|
Projection |
getCoverageProjection()
Get the coverage data projection
|
protected Double |
getCubicInterpolationValue(Double[] values,
double offset)
Interpolate 4 values using the offset between value1 and value2
|
protected Double |
getCubicInterpolationValue(Double value0,
Double value1,
Double value2,
Double value3,
double offset)
Interpolate 4 values using the offset between value1 and value2
|
Double |
getDataNull()
Get the data null value
|
GriddedCoverageEncodingType |
getEncoding()
Get the value pixel encoding type
|
float |
getFloatPixelValue(GriddedTile griddedTile,
Double value)
Get the pixel value of the coverage data value
|
GriddedCoverage |
getGriddedCoverage()
Get the gridded coverage
|
GriddedCoverageDao |
getGriddedCoverageDao()
Get the Gridded Coverage DAO
|
List<GriddedTile> |
getGriddedTile()
Get the gridded tile
|
GriddedTile |
getGriddedTile(long tileId)
Get the gridded tile by id
|
GriddedTileDao |
getGriddedTileDao()
Get the Gridded Tile DAO
|
Integer |
getHeight()
Get the requested coverage data height
|
protected List<int[]> |
getNearestNeighbors(float xSource,
float ySource)
Determine the nearest neighbors of the source pixel, sorted by closest to
farthest neighbor
|
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
|
List<Extensions> |
getOrCreate()
Get or create the extension
|
float |
getPixelValue(float[] pixelValues,
int width,
int x,
int y)
Get the pixel value at the coordinate from the pixel values
|
short |
getPixelValue(GriddedTile griddedTile,
Double value)
Get the "unsigned short" pixel value of the coverage data value
|
short |
getPixelValue(int unsignedPixelValue)
Get the "unsigned short" value from the unsigned 16 bit integer pixel
value
|
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
|
Projection |
getRequestProjection()
Get the request projection
|
static List<String> |
getTables(GeoPackageCore geoPackage)
Get the coverage data tile tables
|
TileMatrixSet |
getTileMatrixSet()
Get the Tile Matrix Set
|
int |
getUnsignedPixelValue(GriddedTile griddedTile,
Double value)
Get the unsigned 16 bit integer pixel value of the coverage data value
|
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
|
int |
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 integer
|
int[] |
getUnsignedPixelValues(short[] pixelValues)
Get the unsigned pixel values.
|
Double |
getValue(double latitude,
double longitude)
Get the coverage data value at the coordinate
|
Double |
getValue(GriddedTile griddedTile,
float pixelValue)
Get the coverage data value for the pixel value
|
Double |
getValue(GriddedTile griddedTile,
int unsignedPixelValue)
Get the coverage data value for the unsigned short pixel value
|
Double |
getValue(GriddedTile griddedTile,
short pixelValue)
Get the coverage data value for the "unsigned short" pixel value
|
abstract Double |
getValue(GriddedTile griddedTile,
TImage image,
int x,
int y)
Get the coverage data value from the image at the coordinate
|
CoverageDataResults |
getValues(BoundingBox requestBoundingBox)
Get the coverage data values within the bounding box
|
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
|
CoverageDataResults |
getValues(CoverageDataRequest request)
Get the requested coverage data values
|
abstract CoverageDataResults |
getValues(CoverageDataRequest request,
Integer width,
Integer height)
Get the requested coverage data values with the requested width and
height
|
Double[] |
getValues(GriddedTile griddedTile,
float[] pixelValues)
Get the coverage data values from the pixel values
|
Double[] |
getValues(GriddedTile griddedTile,
int[] unsignedPixelValues)
Get the coverage data values from the "unsigned short" pixel values
|
Double[] |
getValues(GriddedTile griddedTile,
short[] pixelValues)
Get the coverage data values from the "unsigned short" pixel values
|
CoverageDataResults |
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 width
|
protected float |
getXSource(int x,
float destLeft,
float srcLeft,
float widthRatio)
Determine the x source pixel location
|
protected CoverageDataSourcePixel |
getXSourceMinAndMax(float source)
Get the min, max, and offset of the source X pixel
|
protected float |
getYSource(int y,
float destTop,
float srcTop,
float heightRatio)
Determine the y source pixel location
|
protected CoverageDataSourcePixel |
getYSourceMinAndMax(float source)
Get the min, max, and offset of the source Y pixel
|
boolean |
has()
Determine if the Tile Matrix Set has the extension
|
boolean |
isDataNull(double value)
Check the pixel value to see if it is the null equivalent
|
boolean |
isSameProjection()
Is the request and coverage data projection the same
|
boolean |
isZoomIn()
Is the zooming in (higher zoom level values) enabled to find matching
coverage data
|
boolean |
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 data
|
protected BoundingBox |
padBoundingBox(TileMatrix tileMatrix,
BoundingBox boundingBox,
int overlap)
Pad the bounding box with extra space for the overlapping pixels
|
GriddedCoverage |
queryGriddedCoverage()
Query and update the gridded coverage
|
protected Double[][] |
reprojectCoverageData(Double[][] values,
int requestedCoverageWidth,
int requestedCoverageHeight,
BoundingBox requestBoundingBox,
ProjectionTransform transformRequestToCoverage,
BoundingBox coverageBoundingBox)
Reproject the coverage data to the requested projection
|
void |
setAlgorithm(CoverageDataAlgorithm algorithm)
Set the interpolation algorithm
|
void |
setEncoding(GriddedCoverageEncodingType encoding)
Set the value pixel encoding type
|
void |
setHeight(Integer height)
Set the requested coverage data height
|
void |
setWidth(Integer width)
Set the requested coverage data width
|
void |
setZoomIn(boolean zoomIn)
Set the zoom in enabled state
|
void |
setZoomInBeforeOut(boolean zoomInBeforeOut)
Set the zoom order between in and out
|
void |
setZoomOut(boolean zoomOut)
Set the zoom out enabled state
|
get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, has, haspublic static final String EXTENSION_AUTHOR
public static final String EXTENSION_NAME_NO_AUTHOR
public static final String EXTENSION_NAME
public static final String EXTENSION_DEFINITION
protected Integer width
protected Integer height
protected final Projection requestProjection
protected final Projection coverageProjection
protected final BoundingBox coverageBoundingBox
protected final boolean sameProjection
protected boolean zoomIn
protected boolean zoomOut
protected boolean zoomInBeforeOut
protected CoverageDataAlgorithm algorithm
protected GriddedCoverageEncodingType encoding
protected CoverageDataCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet, Integer width, Integer height, Projection requestProjection)
geoPackage - GeoPackagetileMatrixSet - tile matrix setwidth - specified results widthheight - specified results heightrequestProjection - request projectionprotected CoverageDataCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet)
geoPackage - GeoPackagetileMatrixSet - tile matrix setpublic abstract Double getValue(GriddedTile griddedTile, TImage image, int x, int y)
griddedTile - gridded tileimage - coverage data imagex - x coordinatey - y coordinatepublic abstract CoverageDataResults getValues(CoverageDataRequest request, Integer width, Integer height)
request - coverage data requestwidth - coverage data request widthheight - coverage data request heightpublic abstract CoverageDataResults getValuesUnbounded(CoverageDataRequest request)
request - coverage data requestpublic TileMatrixSet getTileMatrixSet()
public GriddedCoverageDao getGriddedCoverageDao()
public GriddedTileDao getGriddedTileDao()
public Integer getWidth()
public void setWidth(Integer width)
width - requested coverage data widthpublic Integer getHeight()
public void setHeight(Integer height)
height - requested coverage data heightpublic Projection getRequestProjection()
public Projection getCoverageProjection()
public BoundingBox getCoverageBoundingBox()
public boolean isSameProjection()
public boolean isZoomIn()
public void setZoomIn(boolean zoomIn)
zoomIn - true to zoom in when finding coverage data, false to disablepublic boolean isZoomOut()
public void setZoomOut(boolean zoomOut)
zoomOut - true to zoom out when finding coverage data, false to disablepublic boolean isZoomInBeforeOut()
public void setZoomInBeforeOut(boolean zoomInBeforeOut)
zoomInBeforeOut - true to zoom in for results first, false to zoom out firstpublic CoverageDataAlgorithm getAlgorithm()
public void setAlgorithm(CoverageDataAlgorithm algorithm)
algorithm - algorithm typepublic GriddedCoverageEncodingType getEncoding()
public void setEncoding(GriddedCoverageEncodingType encoding)
encoding - encoding typepublic List<Extensions> getOrCreate()
public boolean has()
public GriddedCoverage getGriddedCoverage()
public GriddedCoverage queryGriddedCoverage()
public List<GriddedTile> getGriddedTile()
public GriddedTile getGriddedTile(long tileId)
tileId - tile idpublic Double getDataNull()
public boolean isDataNull(double value)
value - pixel valuepublic static List<String> getTables(GeoPackageCore geoPackage)
geoPackage - GeoPackageprotected Double[][] reprojectCoverageData(Double[][] values, int requestedCoverageWidth, int requestedCoverageHeight, BoundingBox requestBoundingBox, ProjectionTransform transformRequestToCoverage, BoundingBox coverageBoundingBox)
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 boxprotected Double[][] formatUnboundedResults(TileMatrix tileMatrix, Map<Long,Map<Long,Double[][]>> rowsMap, int tileCount, long minRow, long maxRow, long minColumn, long maxColumn)
tileMatrix - tile matrixrowsMap - rows maptileCount - tile countminRow - min rowmaxRow - max rowminColumn - min columnmaxColumn - max columnprotected float getXSource(int x,
float destLeft,
float srcLeft,
float widthRatio)
x - x pixeldestLeft - destination left most pixelsrcLeft - source left most pixelwidthRatio - source over destination width ratioprotected float getYSource(int y,
float destTop,
float srcTop,
float heightRatio)
y - y pixeldestTop - destination top most pixelsrcTop - source top most pixelheightRatio - source over destination height ratioprotected List<int[]> getNearestNeighbors(float xSource, float ySource)
xSource - x source pixelySource - y source pixelprotected CoverageDataSourcePixel getXSourceMinAndMax(float source)
source - source x pixelprotected CoverageDataSourcePixel getYSourceMinAndMax(float source)
source - source y pixelprotected Double getBilinearInterpolationValue(CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY, Double[][] values)
sourcePixelX - source pixel xsourcePixelY - source pixel yvalues - 2 x 2 coverage data values as [y][x]protected Double getBilinearInterpolationValue(float offsetX, float offsetY, float minX, float maxX, float minY, float maxY, Double[][] values)
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]protected Double getBilinearInterpolationValue(float offsetX, float offsetY, float minX, float maxX, float minY, float maxY, Double topLeft, Double topRight, Double bottomLeft, Double bottomRight)
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 valueprotected Double getBicubicInterpolationValue(Double[][] values, CoverageDataSourcePixel sourcePixelX, CoverageDataSourcePixel sourcePixelY)
values - coverage data valuessourcePixelX - source pixel xsourcePixelY - source pixel yprotected Double getBicubicInterpolationValue(Double[][] values, float offsetX, float offsetY)
values - coverage data valuesoffsetX - x source pixel offsetoffsetY - y source pixel offsetprotected Double getCubicInterpolationValue(Double[] values, double offset)
values - coverage data valuesoffset - offset between the middle two pixelsprotected Double getCubicInterpolationValue(Double value0, Double value1, Double value2, Double value3, double offset)
value0 - index 0 valuevalue1 - index 1 valuevalue2 - index 2 valuevalue3 - index 3 valueoffset - offset between the middle two pixelsprotected BoundingBox padBoundingBox(TileMatrix tileMatrix, BoundingBox boundingBox, int overlap)
tileMatrix - tile matrixboundingBox - bounding boxoverlap - overlapping pixelspublic short getPixelValue(short[] pixelValues,
int width,
int x,
int y)
pixelValues - "unsigned short" pixel valueswidth - image widthx - x coordinatey - y coordinatepublic int getUnsignedPixelValue(short[] pixelValues,
int width,
int x,
int y)
pixelValues - "unsigned short" pixel valueswidth - image widthx - x coordinatey - y coordinatepublic int getUnsignedPixelValue(int[] unsignedPixelValues,
int width,
int x,
int y)
unsignedPixelValues - unsigned int pixel valueswidth - image widthx - x coordinatey - y coordinatepublic int getUnsignedPixelValue(short pixelValue)
pixelValue - "unsigned short" pixel valuepublic short getPixelValue(int unsignedPixelValue)
unsignedPixelValue - unsigned 16 bit integer pixel valuepublic int[] getUnsignedPixelValues(short[] pixelValues)
pixelValues - pixel values as "unsigned shorts"public Double getValue(GriddedTile griddedTile, short pixelValue)
griddedTile - gridded tilepixelValue - pixel value as an unsigned shortpublic Double getValue(GriddedTile griddedTile, int unsignedPixelValue)
griddedTile - gridded tileunsignedPixelValue - pixel value as an unsigned 16 bit integerpublic Double[] getValues(GriddedTile griddedTile, short[] pixelValues)
griddedTile - gridded tilepixelValues - pixel values as "unsigned shorts"public Double[] getValues(GriddedTile griddedTile, int[] unsignedPixelValues)
griddedTile - gridded tileunsignedPixelValues - pixel values as 16 bit integerspublic static TileMatrixSet createTileTableWithMetadata(GeoPackageCore geoPackage, String tableName, BoundingBox contentsBoundingBox, long contentsSrsId, BoundingBox tileMatrixSetBoundingBox, long tileMatrixSetSrsId)
geoPackage - GeoPackagetableName - table namecontentsBoundingBox - contents bounding boxcontentsSrsId - contents srs idtileMatrixSetBoundingBox - tile matrix set bounding boxtileMatrixSetSrsId - tile matrix set srs idpublic int getUnsignedPixelValue(GriddedTile griddedTile, Double value)
griddedTile - gridded tilevalue - coverage data valuepublic short getPixelValue(GriddedTile griddedTile, Double value)
griddedTile - gridded tilevalue - coverage data valuepublic float getPixelValue(float[] pixelValues,
int width,
int x,
int y)
pixelValues - pixel valueswidth - image widthx - x coordinatey - y coordinatepublic Double getValue(GriddedTile griddedTile, float pixelValue)
griddedTile - gridded tilepixelValue - pixel valuepublic Double[] getValues(GriddedTile griddedTile, float[] pixelValues)
griddedTile - gridded tilepixelValues - pixel valuespublic float getFloatPixelValue(GriddedTile griddedTile, Double value)
griddedTile - gridded tilevalue - coverage data valuepublic Double getValue(double latitude, double longitude)
latitude - latitudelongitude - longitudepublic CoverageDataResults getValues(BoundingBox requestBoundingBox)
requestBoundingBox - request bounding boxpublic CoverageDataResults getValues(BoundingBox requestBoundingBox, Integer width, Integer height)
requestBoundingBox - request bounding boxwidth - coverage data request widthheight - coverage data request heightpublic CoverageDataResults getValues(CoverageDataRequest request)
request - coverage data requestpublic CoverageDataResults getValuesUnbounded(BoundingBox requestBoundingBox)
requestBoundingBox - request bounding boxprotected 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)
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 pixelprotected 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)
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 pixelprotected 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)
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 pixelCopyright © 2019 National Geospatial-Intelligence Agency. All rights reserved.