public abstract class AbstractElevationModel extends WWObjectImpl implements ElevationModel
Modifier and Type | Field and Description |
---|---|
protected FileStore |
dataFileStore |
protected boolean |
enabled |
protected long |
expiryTime |
protected double |
missingDataFlag |
protected double |
missingDataValue |
protected boolean |
networkRetrievalEnabled |
Constructor and Description |
---|
AbstractElevationModel() |
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 . |
static Element |
createElevationModelConfigElements(AVList params,
Element context)
Appends elevation model configuration parameters as elements to the specified context.
|
void |
dispose()
Disposes of any internal resources allocated by the object.
|
double[] |
getBestResolutions(Sector sector) |
FileStore |
getDataFileStore() |
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.
|
static AVList |
getElevationModelConfigParams(Element domElement,
AVList params)
Parses elevation model configuration parameters from the specified DOM document.
|
double[] |
getElevations(Sector sector,
List<? extends LatLon> latLons,
double[] targetResolutions,
double[] elevations)
Returns the elevations of a collection of locations.
|
long |
getExpiryTime()
Returns the current expiry time.
|
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 |
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.
|
String |
getRestorableState()
Returns an XML document string describing the object's state.
|
double[] |
getUnmappedElevations(Sector sector,
List<? extends LatLon> latLons,
double[] targetResolutions,
double[] elevations)
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.
|
static boolean |
isElevationModelConfigDocument(Element domElement)
Returns true if a specified DOM document is an ElevationModel configuration document, and false otherwise.
|
boolean |
isEnabled()
Indicates whether this elevation model is used or ignored.
|
boolean |
isNetworkRetrievalEnabled()
Indicates whether the elevation model is allowed to retrieve data from the network.
|
protected boolean |
isTransparentValue(Double value) |
void |
restoreState(String stateInXml)
Restores the object's state to what is described in the specified XML document string.
|
void |
setDataFileStore(FileStore dataFileStore) |
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 |
setMissingDataReplacement(double missingDataValue)
Specifies the elevation used for missing values in the elevation model.
|
void |
setMissingDataSignal(double missingDataFlag)
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 enabled)
Controls whether the elevation model is allowed to retrieve data from the network.
|
String |
toString() |
onMessage, propertyChange
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
contains, getBestResolution, getElevations, getExtremeElevations, getExtremeElevations, getMaxElevation, getMinElevation, getUnmappedElevation, getUnmappedElevations, intersects, isExtremesCachingEnabled, setExtremesCachingEnabled
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
propertyChange
onMessage
protected FileStore dataFileStore
protected boolean enabled
protected long expiryTime
protected double missingDataFlag
protected double missingDataValue
protected boolean networkRetrievalEnabled
public void composeElevations(Sector sector, List<? extends LatLon> latlons, int tileWidth, double[] buffer) throws Exception
ElevationModel
Sector
.composeElevations
in interface ElevationModel
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.public static Element createElevationModelConfigElements(AVList params, Element context)
Parameter | Element Path | Type |
AVKey.DISPLAY_NAME | DisplayName | String |
AVKey.NETWORK_RETRIEVAL_ENABLED | NetworkRetrievalEnabled | Boolean |
AVKey.MISSING_DATA_SIGNAL | MissingData/@signal | Double |
AVKey.MISSING_DATA_REPLACEMENT | MissingData/@replacement | Double |
AVKey.DETAIL_HINT | DataDetailHint | Double |
params
- the key-value pairs which define the elevation model configuration parameters.context
- the XML document root on which to append elevation model configuration elements.IllegalArgumentException
- if either the parameters or the context are null.public void dispose()
Disposable
dispose
in interface Disposable
public double[] getBestResolutions(Sector sector)
getBestResolutions
in interface ElevationModel
public FileStore getDataFileStore()
public double getDetailHint(Sector sector)
ElevationModel
getDetailHint
in interface ElevationModel
sector
- the sector in question.public double getElevation(Angle latitude, Angle longitude)
ElevationModel
getElevation
in interface ElevationModel
latitude
- the latitude of the location in question.longitude
- the longitude of the location in question.ElevationModel.setMissingDataSignal(double)
,
ElevationModel.getUnmappedElevation(gov.nasa.worldwind.geom.Angle, gov.nasa.worldwind.geom.Angle)
public static AVList getElevationModelConfigParams(Element domElement, AVList params)
Parameter | Element Path | Type |
AVKey.DISPLAY_NAME | DisplayName | String |
AVKey.NETWORK_RETRIEVAL_ENABLED | NetworkRetrievalEnabled | Boolean |
AVKey.MISSING_DATA_SIGNAL | MissingData/@signal | Double |
AVKey.MISSING_DATA_REPLACEMENT | MissingData/@replacement | Double |
AVKey.DETAIL_HINT | DataDetailHint | Double |
domElement
- the XML document root to parse for elevation model configuration elements.params
- the output key-value pairs which recieve the elevation model configuration parameters. A null
reference is permitted.IllegalArgumentException
- if the document is null.public double[] getElevations(Sector sector, List<? extends LatLon> latLons, double[] targetResolutions, double[] elevations)
ElevationModel
getElevations
in interface ElevationModel
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.targetResolutions
- 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
.elevations
- 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
.ElevationModel.setMissingDataSignal(double)
public long getExpiryTime()
ElevationModel
getExpiryTime
in interface ElevationModel
ElevationModel.setExpiryTime(long)
public double getLocalDataAvailability(Sector sector, Double targetResolution)
ElevationModel
getLocalDataAvailability
in interface ElevationModel
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.public double getMissingDataReplacement()
ElevationModel
getMissingDataReplacement
in interface ElevationModel
ElevationModel.setMissingDataSignal(double)
,
ElevationModel.getMissingDataSignal()
public double getMissingDataSignal()
ElevationModel
getMissingDataSignal
in interface ElevationModel
ElevationModel.getMissingDataReplacement()
public String getName()
ElevationModel
getName
in interface ElevationModel
ElevationModel.setName(String)
public String getRestorableState()
Restorable
restoreState
and passing the XML document.getRestorableState
in interface Restorable
public double[] getUnmappedElevations(Sector sector, List<? extends LatLon> latLons, double[] targetResolutions, double[] elevations)
ElevationModel
getUnmappedElevations
in interface ElevationModel
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.targetResolutions
- 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
.elevations
- 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
.ElevationModel.setMissingDataSignal(double)
public double getUnmappedLocalSourceElevation(Angle latitude, Angle longitude)
ElevationModel
getUnmappedLocalSourceElevation
in interface ElevationModel
latitude
- The latitude of the location whose elevation is desired.longitude
- The longitude of the location whose elevation is desired.ElevationModel.getMissingDataSignal()
).public static boolean isElevationModelConfigDocument(Element domElement)
domElement
- the DOM document in question.IllegalArgumentException
- if document is null.public boolean isEnabled()
ElevationModel
isEnabled
in interface ElevationModel
public boolean isNetworkRetrievalEnabled()
ElevationModel
isNetworkRetrievalEnabled
in interface ElevationModel
true
if the elevation model is enabled to retrieve network data, else false
.protected boolean isTransparentValue(Double value)
public void restoreState(String stateInXml)
Restorable
restoreState
in interface Restorable
stateInXml
- an XML document string describing an object's state.public void setDataFileStore(FileStore dataFileStore)
public void setEnabled(boolean enabled)
ElevationModel
setEnabled
in interface ElevationModel
enabled
- true if this elevation model is used, otherwise false.public void setExpiryTime(long expiryTime)
ElevationModel
setExpiryTime
in interface ElevationModel
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.
public void setMissingDataReplacement(double missingDataValue)
ElevationModel
setMissingDataReplacement
in interface ElevationModel
missingDataValue
- the value that indicates that no data is available at a location.ElevationModel.setMissingDataSignal(double)
public void setMissingDataSignal(double missingDataFlag)
ElevationModel
ElevationModel.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.setMissingDataSignal
in interface ElevationModel
missingDataFlag
- the missing-data signal value. The default is -Double.MAX_VALUE
.ElevationModel.setMissingDataReplacement(double)
,
ElevationModel.getMissingDataSignal()
public void setName(String name)
ElevationModel
setName
in interface ElevationModel
name
- the name to give the elevation model.public void setNetworkRetrievalEnabled(boolean enabled)
ElevationModel
setNetworkRetrievalEnabled
in interface ElevationModel
enabled
- true
if network retrieval is allowed, else false
.