NASA World Wind

gov.nasa.worldwind.globes
Interface ElevationModel

All Superinterfaces:
AVList, EventListener, PropertyChangeListener, Restorable, WWObject
All Known Implementing Classes:
AbstractElevationModel, BasicElevationModel, CompoundElevationModel, EarthLocalElevationModel, HawaiianIslandsElevationModel, LocalElevationModel, WMSBasicElevationModel, ZeroElevationModel

public interface ElevationModel
extends WWObject, Restorable

Provides the elevations a Globe or other object holding elevations.

An ElevationModel often approximates elevations at multiple levels of spatial resolution. For any given viewing position the model determines an appropriate target resolution. That target resolution may not be immediately achievable, however, because the corresponding elevation data might not be locally available and must be retrieved from a remote location. When this is the case, the Elevations object returned for a sector holds the resolution achievable with the data currently available. That resolution may not be the same as the target resolution. The achieved resolution is made available in the interface.


Method Summary
 void composeElevations(Sector sector, List<? extends LatLon> latlons, int tileWidth, double[] buffer)
           
 boolean contains(Angle latitude, Angle longitude)
          Indicates whether a specified location is within the elevation model's domain.
 double getBestResolution(Sector sector)
          Indicates the best resolution attainable for a specified sector.
 double getDetailHint(Sector sector)
          Returns the detail hint associated with the specified sector.
 double getElevation(Angle latitude, Angle longitude)
          Returns the elevation at a specified location, or an unspecified value, typically zero, if an elevation cannot be determined.
 double getElevations(Sector sector, List<? extends LatLon> latlons, double targetResolution, double[] buffer)
          Returns the elevations of a collection of locations.
 long getExpiryTime()
          Returns the current expiry time.
 double[] getExtremeElevations(Angle latitude, Angle longitude)
          Returns the minimum and maximum elevations at a specified location.
 double[] getExtremeElevations(Sector sector)
          Returns the minimum and maximum elevations within a specified sector of the elevation model.
 double getMaxElevation()
          Returns the maximum elevation contained in the elevevation model.
 double getMinElevation()
          Returns the minimum elevation contained in the elevevation model.
 double getMissingDataSignal()
          Returns the current missing-data sentinel.
 String getName()
          Returns the elevation model's name, as specified in the most recent call to setName(java.lang.String).
 double getUnmappedElevation(Angle latitude, Angle longitude)
          Returns the elevation at a specified location, but without mapping missing data to the elevation model's missing data replacement value.
 int intersects(Sector sector)
          Indicates whether the elevation model corresponds to a specified sector.
 boolean isNetworkRetrievalEnabled()
          Indicates whether the elevation model is allowed to retrieve data from the network.
 void setExpiryTime(long expiryTime)
          Specifies the time of the elevation model's most recent dataset update.
 void setMissingDataSignal(double flag)
          Specifies the value used to identify missing data in an elevation model.
 void setName(String name)
          Set the elevation model's name.
 void setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
          Controls whether the elevation model is allowed to retrieve data from the network.
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface gov.nasa.worldwind.Restorable
getRestorableState, restoreState
 

Method Detail

composeElevations

void composeElevations(Sector sector,
                       List<? extends LatLon> latlons,
                       int tileWidth,
                       double[] buffer)
                       throws Exception
Throws:
Exception

contains

boolean contains(Angle latitude,
                 Angle longitude)
Indicates whether a specified location is within the elevation model's domain.

Parameters:
latitude - the latitude of the location in question.
longitude - the longitude of the location in question.
Returns:
true if the location is within the elevation model's domain, otherwise false.

getBestResolution

double getBestResolution(Sector sector)
Indicates the best resolution attainable for a specified sector.

Parameters:
sector - the sector in question. If null, the elevation model's best overall resolution is returned. This is the best attainable at some locations but not necessarily at all locations.
Returns:
the best resolution attainable for the specified sector, in radians, or Double.MAX_VALUE if the sector does not intersect the elevation model.

getDetailHint

double getDetailHint(Sector sector)
Returns the detail hint associated with the specified sector. If the elevation model does not have any detail hint for the sector, this will return zero.

Parameters:
sector - the sector in question.
Returns:
The detail hint corresponding to the specified sector.
Throws:
IllegalArgumentException - if sector is null.

getElevation

double getElevation(Angle latitude,
                    Angle longitude)
Returns the elevation at a specified location, or an unspecified value, typically zero, if an elevation cannot be determined.

Parameters:
latitude - the latitude of the location in question.
longitude - the longitude of the location in question.
Returns:
The elevation corresponding to the specified location, or an elevation-model specific value if the elevation does not contain a value for the location or a value cannot be determined. (The value returned is typically zero, although the elevation model may choose to return some other value.)
See Also:
setMissingDataSignal(double)

getElevations

double getElevations(Sector sector,
                     List<? extends LatLon> latlons,
                     double targetResolution,
                     double[] buffer)
Returns the elevations of a collection of locations.

The missing-data sentinel value, if previously specified, is returned for locations at which an elevation cannot be determined. if a missing-data value has not been specified, an elevation-model specific value, typically zero, is returned.

Parameters:
sector - the sector in question.
latlons - the locations to return elevations for. A value of zero is returned if a location is null.
targetResolution - the desired horizontal resolution, in radians, of the raster or other elevation sample from which elevations are drawn. (To compute radians from a distance, divide the distance by the radius of the globe, ensuring that both the distance and the radius are in the same units.)
buffer - an array in which to place the returned elevations. The array must be pre-allocated and contain at least as many elements as the list of locations.
Returns:
the resolution achieved, in radians, or Double.MAX_VALUE if individual elevations cannot be determined for any of the locations.
See Also:
#setMissingValueSentinel(Double)

getExpiryTime

long getExpiryTime()
Returns the current expiry time.

Returns:
the current expiry time.

getExtremeElevations

double[] getExtremeElevations(Angle latitude,
                              Angle longitude)
Returns the minimum and maximum elevations at a specified location.

Parameters:
latitude - the latitude of the location in question.
longitude - the longitude of the location in question.
Returns:
A two-element double array indicating the minimum and maximum elevations at the specified location, respectively. These values are the global minimum and maximum if the local minimum and maximum values are currently unknown.

getExtremeElevations

double[] getExtremeElevations(Sector sector)
Returns the minimum and maximum elevations within a specified sector of the elevation model.

Parameters:
sector - the sector in question.
Returns:
A two-element double array indicating the sector's minimum and maximum elevations, respectively. These elements are the global minimum and maximum if the local minimum and maximum values are currently unknown.

getMaxElevation

double getMaxElevation()
Returns the maximum elevation contained in the elevevation model. When the elevation model is associated with a globe, this value is the elevation of the highest point on the globe.

Returns:
The maximum elevation of the elevation model.

getMinElevation

double getMinElevation()
Returns the minimum elevation contained in the elevevation model. When associated with a globe, this value is the elevation of the lowest point on the globe. It may be negative, indicating a value below mean surface level. (Sea level in the case of Earth.)

Returns:
The minimum elevation of the model.

getMissingDataSignal

double getMissingDataSignal()
Returns the current missing-data sentinel.

Returns:
the missing-data sentinel, or null if no sentinel has been specified by either the application or the data set.

getName

String getName()
Returns the elevation model's name, as specified in the most recent call to setName(java.lang.String).

Returns:
the elevation model's name.

getUnmappedElevation

double getUnmappedElevation(Angle latitude,
                            Angle longitude)
Returns the elevation at a specified location, but without mapping missing data to the elevation model's missing data replacement value. In the case of missing data values, the missing data signal is returned rather than the missing data replacement value. *

Parameters:
latitude - the latitude of the location for which to return the elevation.
longitude - the longitude of the location for which to return the elevation.
Returns:
the elevation at the specified location, or the elevation model's missing data signal. If no data is currently available for the location, the elevation model's global minimum elevation at that location is returned.

intersects

int intersects(Sector sector)
Indicates whether the elevation model corresponds to a specified sector.

Parameters:
sector - the sector in question.
Returns:
0 if the elevation model fully contains the sector, 1 if the elevation model intersects the sector but does not fully contain it, or -1 if the elevation does not intersect the elevation model.

isNetworkRetrievalEnabled

boolean isNetworkRetrievalEnabled()
Indicates whether the elevation model is allowed to retrieve data from the network. Some elevation models have no need to retrieve data from the network. This state is meaningless for such elevation models.

Returns:
true if the elevation model is enabled to retrieve network data, else false.

setExpiryTime

void setExpiryTime(long expiryTime)
Specifies the time of the elevation model's most recent dataset update. If greater than zero, the model ignores and eliminates any previously cached data older than the time specfied, and requests new information from the data source. If zero, the model uses any expiry times intrinsic to the model, typically initialized at model construction. The default expiry time is 0, thereby enabling a model's intrinsic expiration criteria.

Parameters:
expiryTime - the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch.
See Also:
for a description of milliseconds beyond the epoch.

setMissingDataSignal

void setMissingDataSignal(double flag)
Specifies the value used to identify missing data in an elevation model. Data entries with this value are treated as undefined. The sentinel value is often specified by the metadata of the data set, in which case the elevation model will define that value to be the missing-data sentinel. When ti's not specified in the metadata, the application may specify it via this method.

Parameters:
flag - a reference to the sentinel value. The default value is null, indicating that there is no missing-data sentinel and all data entry values are considered valid.

setName

void setName(String name)
Set the elevation model's name. The name is a convenience attribute typically used to identify the elevation model in user interfaces. By default, an elevation model has no name.

Parameters:
name - the name to assign to the elevation model.

setNetworkRetrievalEnabled

void setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
Controls whether the elevation model is allowed to retrieve data from the network. Some elevation models have no need for data from the network. This state may be set but is meaningless for such elevation models.

Parameters:
networkRetrievalEnabled - true if network retrieval is allowed, else false.

NASA World Wind