public abstract class ElevationTilesCore<TImage extends ElevationImage> extends BaseExtension
| Modifier and Type | Field and Description |
|---|---|
protected ElevationTilesAlgorithm |
algorithm
Interpolation algorithm
|
protected BoundingBox |
elevationBoundingBox
Elevations bounding box
|
protected Projection |
elevationProjection
Projection of the elevations
|
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
Elevation results height
|
protected Projection |
requestProjection
Projection of the requests
|
protected boolean |
sameProjection
Flag indicating the elevation and request projections are the same
|
protected Integer |
width
Elevation results width
|
protected boolean |
zoomIn
True if zooming in should be performed to find a tile matrix with
elevation 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
elevation values
|
extensionsDao, geoPackage| Modifier | Constructor and Description |
|---|---|
protected |
ElevationTilesCore(GeoPackageCore geoPackage,
TileMatrixSet tileMatrixSet)
Constructor for creating extension rows when creating a new elevation
tile table
|
protected |
ElevationTilesCore(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 elevation 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 elevation tiles into a single double
array of elevation
|
ElevationTilesAlgorithm |
getAlgorithm()
Get the interpolation algorithm
|
protected Double |
getBicubicInterpolationElevation(Double[][] values,
ElevationSourcePixel sourcePixelX,
ElevationSourcePixel sourcePixelY)
Get the bicubic interpolation elevation from the 4 x 4 elevation values
|
protected Double |
getBicubicInterpolationElevation(Double[][] values,
float offsetX,
float offsetY)
Get the bicubic interpolation elevation from the 4 x 4 elevation values
|
protected Double |
getBicubicInterpolationElevation(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 elevation
|
protected Double |
getBilinearInterpolationElevation(ElevationSourcePixel sourcePixelX,
ElevationSourcePixel sourcePixelY,
Double[][] values)
Get the Bilinear Interpolation elevation value
|
protected Double |
getBilinearInterpolationElevation(float offsetX,
float offsetY,
float minX,
float maxX,
float minY,
float maxY,
Double[][] values)
Get the Bilinear Interpolation elevation value
|
protected Double |
getBilinearInterpolationElevation(float offsetX,
float offsetY,
float minX,
float maxX,
float minY,
float maxY,
Double topLeft,
Double topRight,
Double bottomLeft,
Double bottomRight)
Get the Bilinear Interpolation elevation value
|
protected Double |
getBilinearInterpolationElevation(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 elevation
|
protected Double |
getCubicInterpolationElevation(Double[] values,
double offset)
Interpolate 4 values using the offset between value1 and value2
|
protected Double |
getCubicInterpolationElevation(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
|
Double |
getElevation(double latitude,
double longitude)
Get the elevation at the coordinate
|
BoundingBox |
getElevationBoundingBox()
Get the elevation bounding box
|
Projection |
getElevationProjection()
Get the elevation projection
|
ElevationTileResults |
getElevations(BoundingBox requestBoundingBox)
Get the elevation values within the bounding box
|
ElevationTileResults |
getElevations(BoundingBox requestBoundingBox,
Integer width,
Integer height)
Get the elevation values within the bounding box with the requested width
and height result size
|
ElevationTileResults |
getElevations(ElevationRequest request)
Get the requested elevation values
|
abstract ElevationTileResults |
getElevations(ElevationRequest request,
Integer width,
Integer height)
Get the requested elevation values with the requested width and height
|
ElevationTileResults |
getElevationsUnbounded(BoundingBox requestBoundingBox)
Get the unbounded elevation values within the bounding box.
|
abstract ElevationTileResults |
getElevationsUnbounded(ElevationRequest request)
Get the requested unbounded elevation values.
|
Double |
getElevationValue(GriddedTile griddedTile,
float pixelValue)
Get the elevation value for the pixel value
|
Double |
getElevationValue(GriddedTile griddedTile,
int unsignedPixelValue)
Get the elevation value for the unsigned short pixel value
|
Double |
getElevationValue(GriddedTile griddedTile,
short pixelValue)
Get the elevation value for the "unsigned short" pixel value
|
abstract Double |
getElevationValue(GriddedTile griddedTile,
TImage image,
int x,
int y)
Get the elevation value from the image at the coordinate
|
Double[] |
getElevationValues(GriddedTile griddedTile,
float[] pixelValues)
Get the elevation values from the pixel values
|
Double[] |
getElevationValues(GriddedTile griddedTile,
int[] unsignedPixelValues)
Get the elevation values from the "unsigned short" pixel values
|
Double[] |
getElevationValues(GriddedTile griddedTile,
short[] pixelValues)
Get the elevation values from the "unsigned short" pixel values
|
float |
getFloatPixelValue(GriddedTile griddedTile,
Double elevation)
Get the pixel value of the elevation
|
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 elevation height
|
protected Double |
getNearestNeighborElevation(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 elevation
|
protected List<int[]> |
getNearestNeighbors(float xSource,
float ySource)
Determine the nearest neighbors of the source pixel, sorted by closest to
farthest neighbor
|
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 elevation)
Get the "unsigned short" pixel value of the elevation
|
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
|
protected ElevationSourcePixel |
getSourceMinAndMax(float source)
Get the min, max, and offset of the source pixel
|
static List<String> |
getTables(GeoPackageCore geoPackage)
Get the elevation tile tables
|
TileMatrixSet |
getTileMatrixSet()
Get the Tile Matrix Set
|
int |
getUnsignedPixelValue(GriddedTile griddedTile,
Double elevation)
Get the unsigned 16 bit integer pixel value of the elevation
|
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.
|
Integer |
getWidth()
Get the requested elevation width
|
protected float |
getXSource(int x,
float destLeft,
float srcLeft,
float widthRatio)
Determine the x source pixel location
|
protected float |
getYSource(int y,
float destTop,
float srcTop,
float heightRatio)
Determine the y source pixel location
|
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 elevation projection the same
|
boolean |
isZoomIn()
Is the zooming in (higher zoom level values) enabled to find matching
elevations
|
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
elevations
|
protected BoundingBox |
padBoundingBox(TileMatrix tileMatrix,
BoundingBox boundingBox,
int overlap)
Pad the bounding box with extra space for the overlapping pixels
|
GriddedCoverage |
queryGriddedCoverage()
Query and updated the gridded coverage
|
protected Double[][] |
reprojectElevations(Double[][] elevations,
int requestedElevationsWidth,
int requestedElevationsHeight,
BoundingBox requestBoundingBox,
ProjectionTransform transformRequestToElevation,
BoundingBox elevationBoundingBox)
Reproject the elevations to the requested projection
|
void |
setAlgorithm(ElevationTilesAlgorithm algorithm)
Set the interpolation algorithm
|
void |
setHeight(Integer height)
Set the requested elevation height
|
void |
setWidth(Integer width)
Set the requested elevation 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, getExtensionsDao, getGeoPackage, getOrCreate, 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 elevationProjection
protected final BoundingBox elevationBoundingBox
protected final boolean sameProjection
protected boolean zoomIn
protected boolean zoomOut
protected boolean zoomInBeforeOut
protected ElevationTilesAlgorithm algorithm
protected ElevationTilesCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet, Integer width, Integer height, Projection requestProjection)
geoPackage - GeoPackagetileMatrixSet - tile matrix setwidth - specified results widthheight - specified results heightrequestProjection - request projectionprotected ElevationTilesCore(GeoPackageCore geoPackage, TileMatrixSet tileMatrixSet)
geoPackage - GeoPackagetileMatrixSet - tile matrix setpublic abstract Double getElevationValue(GriddedTile griddedTile, TImage image, int x, int y)
griddedTile - gridded tileimage - elevation imagex - x coordinatey - y coordinatepublic abstract ElevationTileResults getElevations(ElevationRequest request, Integer width, Integer height)
request - elevation requestwidth - elevation request widthheight - elevation request heightpublic abstract ElevationTileResults getElevationsUnbounded(ElevationRequest request)
request - elevation requestpublic TileMatrixSet getTileMatrixSet()
public GriddedCoverageDao getGriddedCoverageDao()
public GriddedTileDao getGriddedTileDao()
public Integer getWidth()
public void setWidth(Integer width)
width - requested elevation widthpublic Integer getHeight()
public void setHeight(Integer height)
height - requested elevation heightpublic Projection getRequestProjection()
public Projection getElevationProjection()
public BoundingBox getElevationBoundingBox()
public boolean isSameProjection()
public boolean isZoomIn()
public void setZoomIn(boolean zoomIn)
zoomIn - true to zoom in when finding elevations, false to disablepublic boolean isZoomOut()
public void setZoomOut(boolean zoomOut)
zoomOut - true to zoom out when finding elevations, false to disablepublic boolean isZoomInBeforeOut()
public void setZoomInBeforeOut(boolean zoomInBeforeOut)
zoomInBeforeOut - true to zoom in for results first, false to zoom out firstpublic ElevationTilesAlgorithm getAlgorithm()
public void setAlgorithm(ElevationTilesAlgorithm algorithm)
algorithm - algorithm 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[][] reprojectElevations(Double[][] elevations, int requestedElevationsWidth, int requestedElevationsHeight, BoundingBox requestBoundingBox, ProjectionTransform transformRequestToElevation, BoundingBox elevationBoundingBox)
elevations - elevationsrequestedElevationsWidth - requested elevations widthrequestedElevationsHeight - requested elevations heightrequestBoundingBox - request bounding box in the request projectiontransformRequestToElevation - transformation from request to elevationselevationBoundingBox - elevations 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 radioprotected 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 radioprotected List<int[]> getNearestNeighbors(float xSource, float ySource)
xSource - x source pixelySource - y source pixelprotected ElevationSourcePixel getSourceMinAndMax(float source)
source - source pixelprotected Double getBilinearInterpolationElevation(ElevationSourcePixel sourcePixelX, ElevationSourcePixel sourcePixelY, Double[][] values)
sourcePixelX - source pixel xsourcePixelY - source pixel yvalues - 2 x 2 elevation values as [y][x]protected Double getBilinearInterpolationElevation(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 elevation values as [y][x]protected Double getBilinearInterpolationElevation(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 elevationtopRight - top right elevationbottomLeft - bottom left elevationbottomRight - bottom right elevationprotected Double getBicubicInterpolationElevation(Double[][] values, ElevationSourcePixel sourcePixelX, ElevationSourcePixel sourcePixelY)
values - elevation valuessourcePixelX - source pixel xsourcePixelY - source pixel yprotected Double getBicubicInterpolationElevation(Double[][] values, float offsetX, float offsetY)
values - elevation valuesoffsetX - x source pixel offsetoffsetY - y source pixel offsetprotected Double getCubicInterpolationElevation(Double[] values, double offset)
values - elevation valuesoffset - offset between the middle two pixelsprotected Double getCubicInterpolationElevation(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 getElevationValue(GriddedTile griddedTile, short pixelValue)
griddedTile - gridded tilepixelValue - pixel value as an unsigned shortpublic Double getElevationValue(GriddedTile griddedTile, int unsignedPixelValue)
griddedTile - gridded tileunsignedPixelValue - pixel value as an unsigned 16 bit integerpublic Double[] getElevationValues(GriddedTile griddedTile, short[] pixelValues)
griddedTile - gridded tilepixelValues - pixel values as "unsigned shorts"public Double[] getElevationValues(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 - tableName - contentsBoundingBox - contentsSrsId - tileMatrixSetBoundingBox - tileMatrixSetSrsId - public int getUnsignedPixelValue(GriddedTile griddedTile, Double elevation)
griddedTile - gridded tileelevation - elevation valuepublic short getPixelValue(GriddedTile griddedTile, Double elevation)
griddedTile - gridded tileelevation - elevation valuepublic float getPixelValue(float[] pixelValues,
int width,
int x,
int y)
pixelValues - pixel valueswidth - image widthx - x coordinatey - y coordinatepublic Double getElevationValue(GriddedTile griddedTile, float pixelValue)
griddedTile - gridded tilepixelValue - pixel valuepublic Double[] getElevationValues(GriddedTile griddedTile, float[] pixelValues)
griddedTile - gridded tilepixelValues - pixel valuespublic float getFloatPixelValue(GriddedTile griddedTile, Double elevation)
griddedTile - gridded tileelevation - elevation valuepublic Double getElevation(double latitude, double longitude)
latitude - latitudelongitude - longitudepublic ElevationTileResults getElevations(BoundingBox requestBoundingBox)
requestBoundingBox - request bounding boxpublic ElevationTileResults getElevations(BoundingBox requestBoundingBox, Integer width, Integer height)
requestBoundingBox - request bounding boxwidth - elevation request widthheight - elevation request heightpublic ElevationTileResults getElevations(ElevationRequest request)
request - elevation requestpublic ElevationTileResults getElevationsUnbounded(BoundingBox requestBoundingBox)
requestBoundingBox - request bounding boxprotected Double getBilinearInterpolationElevation(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 getBicubicInterpolationElevation(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 getNearestNeighborElevation(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 © 2017 National Geospatial-Intelligence Agency. All rights reserved.