Class TLcdEarthElevationData
java.lang.Object
com.luciad.earth.tileset.datatype.TLcdEarthMultivaluedData
com.luciad.earth.tileset.datatype.TLcdEarthElevationData
A container for a 2D array of elevation values.
The elevation values should be regularly sampled at the centers of a regular grid of
w x h
cells. Where w
and h
are respectively the number of horizontal and
vertical elevations of the elevation data.
A value of Double.NaN
indicates transparency (no elevation data available).
Some formats will provide the minimum and maximum value of the elevation data.
When not available, null
will be returned for the minimum and maximum value.
- Since:
- 8.2
-
Constructor Summary
ConstructorDescriptionTLcdEarthElevationData
(double[] aElevations, int aWidth, int aHeight) Constructs a newTLcdEarthElevationData
with the specified data.TLcdEarthElevationData
(double[] aElevations, int aWidth, int aHeight, double aMinElevation, double aMaxElevation) Constructs a newTLcdEarthElevationData
with the specified data, including minimum and maximum elevation values. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getElevation
(int aX, int aY) Returns the elevation at the given position.double[]
Returns the array of elevation values.Gets the maximum elevation value in the data.Gets the minimum elevation value in the data.int
Returns1
.Methods inherited from class com.luciad.earth.tileset.datatype.TLcdEarthMultivaluedData
getHeight, getMaximumValue, getMinimumValue, getMinMaxValues, getValueAt, getValues, getValues, getWidth
-
Constructor Details
-
TLcdEarthElevationData
public TLcdEarthElevationData(double[] aElevations, int aWidth, int aHeight) Constructs a newTLcdEarthElevationData
with the specified data.- Parameters:
aElevations
- the array of elevation values. This array should containaWidth x aHeight
elevation values ordered in row-major form (e.g. the rows are put one after another)aWidth
- the number of elevation values in a rowaHeight
- the number of elevation values in a column
-
TLcdEarthElevationData
public TLcdEarthElevationData(double[] aElevations, int aWidth, int aHeight, double aMinElevation, double aMaxElevation) Constructs a newTLcdEarthElevationData
with the specified data, including minimum and maximum elevation values.- Parameters:
aElevations
- the array of elevation values. This array should containaWidth x aHeight
elevation values ordered in row-major form (e.g. the rows are put one after another)aWidth
- the number of elevation values in a rowaHeight
- the number of elevation values in a columnaMinElevation
- the minimum elevation value in the data, ornull
aMaxElevation
- the maximum elevation value in the data, ornull
-
-
Method Details
-
getElevations
public double[] getElevations()Returns the array of elevation values. This array is ordered in row-major form (i.e. the rows are put one after another).- Returns:
- The array with elevation values.
-
getElevation
public double getElevation(int aX, int aY) Returns the elevation at the given position.- Parameters:
aX
- The x coordinate in [0,TLcdEarthMultivaluedData.getWidth()
[.aY
- The y coordinate in [0,TLcdEarthMultivaluedData.getHeight()
[.- Returns:
- The elevation value.
-
getMinElevation
Gets the minimum elevation value in the data. A value ofDouble.NaN
indicates full transparency.- Returns:
- minimum elevation, or
null
if not available
-
getMaxElevation
Gets the maximum elevation value in the data. A value ofDouble.NaN
indicates full transparency.- Returns:
- minimum elevation or
null
if not available
-
getParameterCount
public int getParameterCount()Returns1
.- Overrides:
getParameterCount
in classTLcdEarthMultivaluedData
- Returns:
1
-