public interface ElevationModel extends WWObject, Restorable, Disposable
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.
Modifier and Type | Method and Description |
---|---|
void |
composeElevations(Sector sector,
List<? extends LatLon> latlons,
int tileWidth,
double[] buffer)
Determines the elevations at specified locations within a specified
Sector . |
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[] |
getBestResolutions(Sector 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.
|
double[] |
getElevations(Sector sector,
List<? extends LatLon> latlons,
double[] targetResolution,
double[] buffer)
Returns the elevations of a collection of locations.
|
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 |
getLocalDataAvailability(Sector sector,
Double targetResolution)
Returns the proportion of this elevation model's data that is local -- in the computer's data cache or installed
data filestore -- for a specified sector and target resolution.
|
double |
getMaxElevation()
Returns the maximum elevation contained in the elevation model.
|
double |
getMinElevation()
Returns the minimum elevation contained in the elevation model.
|
double |
getMissingDataReplacement()
Returns the elevation used for missing values in the elevation model.
|
double |
getMissingDataSignal()
Returns the current missing-data signal.
|
String |
getName()
Returns the elevation model's name.
|
double |
getUnmappedElevation(Angle latitude,
Angle longitude)
Returns the elevation at a specified location, but without replacing missing data with the elevation model's
missing data replacement value.
|
double[] |
getUnmappedElevations(Sector sector,
List<? extends LatLon> latlons,
double[] targetResolution,
double[] buffer)
Returns the elevations of a collection of locations.
|
double |
getUnmappedElevations(Sector sector,
List<? extends LatLon> latlons,
double targetResolution,
double[] buffer)
Returns the elevations of a collection of locations.
|
double |
getUnmappedLocalSourceElevation(Angle latitude,
Angle longitude)
Returns the elevation for this elevation model's highest level of detail if the source file for that level and
the specified location exists in the local elevation cache on disk.
|
int |
intersects(Sector sector)
Indicates whether the elevation model covers a specified sector either partially or fully.
|
boolean |
isEnabled()
Indicates whether this elevation model is used or ignored.
|
boolean |
isExtremesCachingEnabled()
Indicates whether extreme value caching is enabled.
|
boolean |
isNetworkRetrievalEnabled()
Indicates whether the elevation model is allowed to retrieve data from the network.
|
void |
setEnabled(boolean enabled)
Indicates whether this elevation model is used or ignored.
|
void |
setExpiryTime(long expiryTime)
Specifies the time of the elevation model's most recent dataset update.
|
void |
setExtremesCachingEnabled(boolean enabled)
Indicates whether extreme values of sectors should be cached as they're computed.
|
void |
setMissingDataReplacement(double missingDataValue)
Specifies the elevation used for missing values in the elevation model.
|
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.
|
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
propertyChange
onMessage
getRestorableState, restoreState
dispose
void composeElevations(Sector sector, List<? extends LatLon> latlons, int tileWidth, double[] buffer) throws Exception
Sector
.sector
- the sector containing the locations.latlons
- the locations for which to return elevations.tileWidth
- the number of locations that comprise one row in the latlons
argument.buffer
- a buffer in which to put the elevations. The buffer must have at least as many elements as the
number of specified locations.Exception
- if the method fails. Different elevation models may fail for different reasons.IllegalArgumentException
- if either the sector, list of locations or buffer is null, if the buffer size is
not at least as large as the location list, or the tile width is greater than
the locations list length or less than 1.boolean contains(Angle latitude, Angle longitude)
latitude
- the latitude of the location in question.longitude
- the longitude of the location in question.double getBestResolution(Sector sector)
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.Double.MAX_VALUE
if the
sector does not intersect the elevation model.double[] getBestResolutions(Sector sector)
double getDetailHint(Sector sector)
sector
- the sector in question.IllegalArgumentException
- if sector
is null.double getElevation(Angle latitude, Angle longitude)
latitude
- the latitude of the location in question.longitude
- the longitude of the location in question.setMissingDataSignal(double)
,
getUnmappedElevation(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle)
double[] getElevations(Sector sector, List<? extends LatLon> latlons, double[] targetResolution, double[] buffer)
sector
- the sector in question.latlons
- the locations to return elevations for. If a location is null, the output buffer for that
location is not modified.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.) This is an array to enable specification of a target resolution per
elevation model for CompoundElevationModel
. The
entries must be in the same order as the elevations in CompoundElevationModel
.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.Double.MAX_VALUE
if individual elevations
cannot be determined for all of the locations. The entries are in the same order as the elevations in
CompoundElevationModel
.IllegalArgumentException
- if either the sector, latlons list, target resolutions array or elevations array
is null.setMissingDataSignal(double)
double getElevations(Sector sector, List<? extends LatLon> latlons, double targetResolution, double[] buffer)
sector
- the sector in question.latlons
- the locations to return elevations for. If a location is null, the output buffer for that
location is not modified.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.Double.MAX_VALUE
if individual elevations cannot be
determined for all of the locations.IllegalArgumentException
- if either the sector, latlons list or elevations array is null.setMissingDataSignal(double)
long getExpiryTime()
setExpiryTime(long)
double[] getExtremeElevations(Angle latitude, Angle longitude)
latitude
- the latitude of the location in question.longitude
- the longitude of the location in question.double
array indicating, respectively, the minimum and maximum elevations at
the specified location. These values are the global minimum and maximum if the local minimum and maximum
values are currently unknown.double[] getExtremeElevations(Sector sector)
sector
- the sector in question.double
array indicating, respectively, the sector's minimum and maximum
elevations. These elements are the global minimum and maximum if the local minimum and maximum values are
currently unknown.double getLocalDataAvailability(Sector sector, Double targetResolution)
sector
- the sector of interest.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.) Specify null to use this elevation model's best resolution.double getMaxElevation()
double getMinElevation()
double getMissingDataReplacement()
setMissingDataSignal(double)
,
getMissingDataSignal()
double getMissingDataSignal()
getMissingDataReplacement()
String getName()
setName(String)
double getUnmappedElevation(Angle latitude, Angle longitude)
latitude
- the latitude of the location for which to return the elevation.longitude
- the longitude of the location for which to return the elevation.double[] getUnmappedElevations(Sector sector, List<? extends LatLon> latlons, double[] targetResolution, double[] buffer)
sector
- the sector in question.latlons
- the locations to return elevations for. If a location is null, the output buffer for that
location is not modified.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.) This is an array to enable specification of a target resolution per
elevation model for CompoundElevationModel
. The
entries must be in the same order as the elevations in CompoundElevationModel
.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.Double.MAX_VALUE
if individual elevations
cannot be determined for all of the locations. The entries are in the same order as the elevations in
CompoundElevationModel
.IllegalArgumentException
- if either the sector, latlons list, target resolutions array or elevations
arraysetMissingDataSignal(double)
double getUnmappedElevations(Sector sector, List<? extends LatLon> latlons, double targetResolution, double[] buffer)
sector
- the sector in question.latlons
- the locations to return elevations for. If a location is null, the output buffer for that
location is not modified.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.Double.MAX_VALUE
if individual elevations cannot be
determined for all of the locations.setMissingDataSignal(double)
double getUnmappedLocalSourceElevation(Angle latitude, Angle longitude)
latitude
- The latitude of the location whose elevation is desired.longitude
- The longitude of the location whose elevation is desired.getMissingDataSignal()
).int intersects(Sector sector)
sector
- the sector in question.boolean isEnabled()
boolean isExtremesCachingEnabled()
setExtremesCachingEnabled(boolean)
boolean isNetworkRetrievalEnabled()
true
if the elevation model is enabled to retrieve network data, else false
.void setEnabled(boolean enabled)
enabled
- true if this elevation model is used, otherwise false.void setExpiryTime(long expiryTime)
expiryTime
- the expiry time of any cached data, expressed as a number of milliseconds beyond the epoch.for a description of milliseconds beyond the epoch.
void setExtremesCachingEnabled(boolean enabled)
enabled
- true if extreme value caching should be performed.void setMissingDataReplacement(double missingDataValue)
missingDataValue
- the value that indicates that no data is available at a location.setMissingDataSignal(double)
void setMissingDataSignal(double flag)
setMissingDataReplacement(double)
.
The missing-data value is often specified by the metadata of the data set, in which case the elevation model
automatically defines that value to be the missing-data signal. When the missing-data signal is not specified in
the metadata, the application may specify it via this method.flag
- the missing-data signal value. The default is -Double.MAX_VALUE
.setMissingDataReplacement(double)
,
getMissingDataSignal()
void setName(String name)
name
- the name to give the elevation model.void setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
networkRetrievalEnabled
- true
if network retrieval is allowed, else false
.