public abstract class BaseElevationModel extends Object implements ElevationModel, Resampling.Raster
Modifier and Type | Field and Description |
---|---|
protected int |
DEGREE_RES |
protected double |
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X |
protected double |
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X_inv |
protected double |
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y |
protected double |
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y_inv |
protected ElevationModelDescriptor |
descriptor |
protected ElevationFile[][] |
elevationFiles |
protected double |
NO_DATA_VALUE |
protected int |
NUM_PIXELS_PER_TILE_X |
protected double |
NUM_PIXELS_PER_TILE_X_inv |
protected int |
NUM_PIXELS_PER_TILE_Y |
protected double |
NUM_PIXELS_PER_TILE_Y_inv |
protected int |
NUM_X_TILES |
protected int |
NUM_Y_TILES |
protected int |
RASTER_HEIGHT |
protected int |
RASTER_WIDTH |
protected Resampling |
resampling |
protected Resampling.Raster |
resamplingRaster |
Constructor and Description |
---|
BaseElevationModel(ElevationModelDescriptor descriptor,
Resampling resamplingMethod) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
createElevationFile(ElevationFile[][] elevationFiles,
int x,
int y,
File demInstallDir) |
void |
dispose()
Releases all of the resources used by this object instance and all of its owned children.
|
ElevationModelDescriptor |
getDescriptor()
Gets the descriptor of this DEM.
|
double |
getElevation(GeoPos geoPos)
Gets the elevation at the geographical coordinate in meters.
|
abstract GeoPos |
getGeoPos(PixelPos pixelPos)
Gets the geographical coordinates for the input pixel coordinates in the DEM reference system.
|
int |
getHeight()
Gets the raster's height.
|
PixelPos |
getIndex(GeoPos geoPos)
Gets the pixel index in the DEM reference system at the geographical coordinate in meters.
|
abstract double |
getIndexX(GeoPos geoPos) |
abstract double |
getIndexY(GeoPos geoPos) |
protected static ProductReaderPlugIn |
getReaderPlugIn(String formatName) |
Resampling |
getResampling() |
double |
getSample(double pixelX,
double pixelY)
Gets the elevation at the point defined by (x,y) coordinates in DEM reference system.
|
boolean |
getSamples(int[] xArray,
int[] yArray,
double[][] samples)
Gets the elevations at the points defined by (x,y) coordinates in DEM reference system.
|
int |
getWidth()
Gets the raster's width.
|
protected void |
setMaxCacheSize(int size) |
void |
updateCache(ElevationTile tile) |
protected final int NUM_X_TILES
protected final int NUM_Y_TILES
protected int NUM_PIXELS_PER_TILE_X
protected int NUM_PIXELS_PER_TILE_Y
protected double NUM_PIXELS_PER_TILE_X_inv
protected double NUM_PIXELS_PER_TILE_Y_inv
protected final double NO_DATA_VALUE
protected int DEGREE_RES
protected int RASTER_WIDTH
protected int RASTER_HEIGHT
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X_inv
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y_inv
protected final ElevationModelDescriptor descriptor
protected final ElevationFile[][] elevationFiles
protected final Resampling resampling
protected final Resampling.Raster resamplingRaster
public BaseElevationModel(ElevationModelDescriptor descriptor, Resampling resamplingMethod)
public Resampling getResampling()
getResampling
in interface ElevationModel
public ElevationModelDescriptor getDescriptor()
ElevationModel
getDescriptor
in interface ElevationModel
protected void setMaxCacheSize(int size)
public double getElevation(GeoPos geoPos) throws Exception
ElevationModel
getElevation
in interface ElevationModel
geoPos
- the geographical coordinateElevationModelDescriptor.getNoDataValue()
if an elevation is not availableException
- if a non-runtime error occurs, e.g I/O errorpublic abstract double getIndexX(GeoPos geoPos)
public abstract double getIndexY(GeoPos geoPos)
public abstract GeoPos getGeoPos(PixelPos pixelPos)
ElevationModel
getGeoPos
in interface ElevationModel
pixelPos
- the pixel (x,y) coordinatepublic PixelPos getIndex(GeoPos geoPos)
ElevationModel
getIndex
in interface ElevationModel
geoPos
- the geographical coordinatepublic int getWidth()
Resampling.Raster
getWidth
in interface Resampling.Raster
public int getHeight()
Resampling.Raster
getHeight
in interface Resampling.Raster
public void updateCache(ElevationTile tile)
public final double getSample(double pixelX, double pixelY) throws Exception
ElevationModel
getSample
in interface ElevationModel
pixelX
- coordinatepixelY
- coordinateElevationModelDescriptor.getNoDataValue()
if an elevation is not availableException
- if a non-runtime error occurs, e.g I/O errorpublic final boolean getSamples(int[] xArray, int[] yArray, double[][] samples) throws Exception
ElevationModel
getSamples
in interface ElevationModel
getSamples
in interface Resampling.Raster
xArray
- coordinateyArray
- coordinatesamples
- output elevation in meters, or the special value returned by ElevationModelDescriptor.getNoDataValue()
if an elevation is not availableException
- if a non-runtime error occurs, e.g I/O errorpublic void dispose()
ElevationModel
This method should be called only if it is for sure that this object instance will never be used again. The
results of referencing an instance of this class after a call to dispose()
are undefined.
Overrides of this method should always call super.dispose();
after disposing this instance.
dispose
in interface ElevationModel
protected abstract void createElevationFile(ElevationFile[][] elevationFiles, int x, int y, File demInstallDir)
protected static ProductReaderPlugIn getReaderPlugIn(String formatName)
Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.