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 |
protected double |
DEGREE_RES_BY_NUM_PIXELS_PER_TILEinv |
protected ElevationModelDescriptor |
descriptor |
protected double |
NO_DATA_VALUE |
protected int |
NUM_PIXELS_PER_TILE |
protected int |
NUM_Y_TILES |
protected int |
RASTER_HEIGHT |
protected Resampling |
resampling |
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_Y_TILES
protected final int NUM_PIXELS_PER_TILE
protected final double NO_DATA_VALUE
protected final int DEGREE_RES
protected final int RASTER_HEIGHT
protected final double DEGREE_RES_BY_NUM_PIXELS_PER_TILE
protected final double DEGREE_RES_BY_NUM_PIXELS_PER_TILEinv
protected final ElevationModelDescriptor descriptor
protected final Resampling resampling
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–2017 European Space Agency (ESA). All rights reserved.