Package org.esa.snap.core.dataop.dem
Class BaseElevationModel
java.lang.Object
org.esa.snap.core.dataop.dem.BaseElevationModel
- All Implemented Interfaces:
ElevationModel,Resampling.Raster
public abstract class BaseElevationModel
extends Object
implements ElevationModel, Resampling.Raster
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected doubleprotected doubleprotected doubleprotected doubleprotected final ElevationModelDescriptorprotected final ElevationFile[][]protected final doubleprotected intprotected doubleprotected intprotected doubleprotected final intprotected final intprotected intprotected intprotected final Resamplingprotected final Resampling.Raster -
Constructor Summary
ConstructorsConstructorDescriptionBaseElevationModel(ElevationModelDescriptor descriptor, Resampling resamplingMethod) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidcreateElevationFile(ElevationFile[][] elevationFiles, int x, int y, File demInstallDir) voiddispose()Releases all of the resources used by this object instance and all of its owned children.Gets the descriptor of this DEM.doublegetElevation(GeoPos geoPos) Gets the elevation at the geographical coordinate in meters.abstract GeoPosGets the geographical coordinates for the input pixel coordinates in the DEM reference system.intGets the raster's height.Gets the pixel index in the DEM reference system at the geographical coordinate in meters.abstract doubleabstract doubleprotected static ProductReaderPlugIngetReaderPlugIn(String formatName) final doublegetSample(double pixelX, double pixelY) Gets the elevation at the point defined by (x,y) coordinates in DEM reference system.final booleangetSamples(int[] xArray, int[] yArray, double[][] samples) Gets the elevations at the points defined by (x,y) coordinates in DEM reference system.intgetWidth()Gets the raster's width.protected voidsetMaxCacheSize(int size) voidupdateCache(ElevationTile tile)
-
Field Details
-
NUM_X_TILES
protected final int NUM_X_TILES -
NUM_Y_TILES
protected final int NUM_Y_TILES -
NUM_PIXELS_PER_TILE_X
protected int NUM_PIXELS_PER_TILE_X -
NUM_PIXELS_PER_TILE_Y
protected int NUM_PIXELS_PER_TILE_Y -
NUM_PIXELS_PER_TILE_X_inv
protected double NUM_PIXELS_PER_TILE_X_inv -
NUM_PIXELS_PER_TILE_Y_inv
protected double NUM_PIXELS_PER_TILE_Y_inv -
NO_DATA_VALUE
protected final double NO_DATA_VALUE -
DEGREE_RES
protected int DEGREE_RES -
RASTER_WIDTH
protected int RASTER_WIDTH -
RASTER_HEIGHT
protected int RASTER_HEIGHT -
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X -
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y -
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X_inv
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_X_inv -
DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y_inv
protected double DEGREE_RES_BY_NUM_PIXELS_PER_TILE_Y_inv -
descriptor
-
elevationFiles
-
resampling
-
resamplingRaster
-
-
Constructor Details
-
BaseElevationModel
-
-
Method Details
-
getResampling
- Specified by:
getResamplingin interfaceElevationModel- Returns:
- The resampling method used.
-
getDescriptor
Description copied from interface:ElevationModelGets the descriptor of this DEM.- Specified by:
getDescriptorin interfaceElevationModel- Returns:
- the descriptor which is never null
-
setMaxCacheSize
protected void setMaxCacheSize(int size) -
getElevation
Description copied from interface:ElevationModelGets the elevation at the geographical coordinate in meters.- Specified by:
getElevationin interfaceElevationModel- Parameters:
geoPos- the geographical coordinate- Returns:
- an elevation in meters, or the special value returned by
ElevationModelDescriptor.getNoDataValue()if an elevation is not available - Throws:
Exception- if a non-runtime error occurs, e.g I/O error
-
getIndexX
-
getIndexY
-
getGeoPos
Description copied from interface:ElevationModelGets the geographical coordinates for the input pixel coordinates in the DEM reference system.- Specified by:
getGeoPosin interfaceElevationModel- Parameters:
pixelPos- the pixel (x,y) coordinate- Returns:
- (lat, lon) geographical coordinates in the reference system of a given DEM
-
getIndex
Description copied from interface:ElevationModelGets the pixel index in the DEM reference system at the geographical coordinate in meters.- Specified by:
getIndexin interfaceElevationModel- Parameters:
geoPos- the geographical coordinate- Returns:
- (x, y) coordinates in the reference system of a given DEM
-
getWidth
public int getWidth()Description copied from interface:Resampling.RasterGets the raster's width.- Specified by:
getWidthin interfaceResampling.Raster- Returns:
- the raster's width
-
getHeight
public int getHeight()Description copied from interface:Resampling.RasterGets the raster's height.- Specified by:
getHeightin interfaceResampling.Raster- Returns:
- the raster's height
-
updateCache
-
getSample
Description copied from interface:ElevationModelGets the elevation at the point defined by (x,y) coordinates in DEM reference system. This method does not interpolated the elevation map!- Specified by:
getSamplein interfaceElevationModel- Parameters:
pixelX- coordinatepixelY- coordinate- Returns:
- an elevation in meters, or the special value returned by
ElevationModelDescriptor.getNoDataValue()if an elevation is not available - Throws:
Exception- if a non-runtime error occurs, e.g I/O error
-
getSamples
Description copied from interface:ElevationModelGets the elevations at the points defined by (x,y) coordinates in DEM reference system. This method does not interpolated the elevation map!- Specified by:
getSamplesin interfaceElevationModel- Specified by:
getSamplesin interfaceResampling.Raster- Parameters:
xArray- coordinateyArray- coordinatesamples- output elevation in meters, or the special value returned byElevationModelDescriptor.getNoDataValue()if an elevation is not available- Returns:
- false if all values are nodata value
- Throws:
Exception- if a non-runtime error occurs, e.g I/O error
-
dispose
public void dispose()Description copied from interface:ElevationModelReleases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.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.- Specified by:
disposein interfaceElevationModel
-
createElevationFile
protected abstract void createElevationFile(ElevationFile[][] elevationFiles, int x, int y, File demInstallDir) -
getReaderPlugIn
-