public class CompoundElevationModel extends AbstractElevationModel
Modifier and Type | Field and Description |
---|---|
protected java.util.concurrent.CopyOnWriteArrayList<ElevationModel> |
elevationModels |
dataFileStore, enabled, expiryTime, missingDataFlag, missingDataValue, networkRetrievalEnabled
Constructor and Description |
---|
CompoundElevationModel() |
Modifier and Type | Method and Description |
---|---|
void |
addElevationModel(ElevationModel em)
Adds an elevation to this compound elevation model.
|
void |
addElevationModel(int index,
ElevationModel em)
Adds a specified elevation model to a specified position in this compound elevation model's elevation model list.
|
void |
composeElevations(Sector sector,
java.util.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.
|
boolean |
containsElevationModel(ElevationModel em)
Returns true if this CompoundElevationModel contains the specified ElevationModel, and false otherwise.
|
void |
dispose()
Disposes of any internal resources allocated by the object.
|
protected double[] |
doGetElevations(Sector sector,
java.util.List<? extends LatLon> latlons,
double[] targetResolution,
double[] buffer,
boolean mapMissingData) |
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.
|
java.util.List<ElevationModel> |
getElevationModels() |
double[] |
getElevations(Sector sector,
java.util.List<? extends LatLon> latLons,
double[] targetResolutions,
double[] elevations)
Returns the elevations of a collection of locations.
|
double |
getElevations(Sector sector,
java.util.List<? extends LatLon> latlons,
double targetResolution,
double[] buffer)
Returns the elevations of a collection of locations.
|
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,
java.lang.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 |
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,
java.util.List<? extends LatLon> latLons,
double[] targetResolutions,
double[] elevations)
Returns the elevations of a collection of locations.
|
double |
getUnmappedElevations(Sector sector,
java.util.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 at a specified location 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 |
isExtremesCachingEnabled()
Indicates whether extreme value caching is enabled.
|
void |
removeElevationModel(ElevationModel em) |
void |
removeElevationModel(int index) |
void |
setElevationModel(int index,
ElevationModel em) |
void |
setExpiryTime(long expiryTime)
Recursively specifies the time of the most recent dataset update for this compound model, and for each elevation
model contained within this compound model.
|
void |
setExtremesCachingEnabled(boolean enabled)
Indicates whether extreme values of sectors should be cached as they're computed.
|
void |
setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
Controls whether the elevation model is allowed to retrieve data from the network.
|
protected void |
sortElevationModels() |
createElevationModelConfigElements, getDataFileStore, getElevation, getElevationModelConfigParams, getExpiryTime, getMissingDataReplacement, getMissingDataSignal, getName, getRestorableState, isElevationModelConfigDocument, isEnabled, isNetworkRetrievalEnabled, isTransparentValue, restoreState, setDataFileStore, setEnabled, setMissingDataReplacement, setMissingDataSignal, setName, 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
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
onMessage
protected java.util.concurrent.CopyOnWriteArrayList<ElevationModel> elevationModels
public void addElevationModel(ElevationModel em)
em
- The elevation model to add.java.lang.IllegalArgumentException
- if the specified elevation model is null.public void addElevationModel(int index, ElevationModel em)
addElevationModel(gov.nasa.worldwind.globes.ElevationModel)
inserts added elevation models at the
appropriate place in the list. This method, however, inserts the elevation model at the specified position in the
list. For proper operation of this compound elevation model, the caller should ensure that the specified position
is the appropriate one for the inserted elevation model's resolution.index
- The position at which to insert the specified model, zero origin. Existing models are shifted to the
right.em
- The elevation model to insert.java.lang.IllegalArgumentException
- if the specified elevation model is null.java.lang.IndexOutOfBoundsException
- if the specified index is invalid.public void composeElevations(Sector sector, java.util.List<? extends LatLon> latlons, int tileWidth, double[] buffer) throws java.lang.Exception
ElevationModel
Sector
.composeElevations
in interface ElevationModel
composeElevations
in class AbstractElevationModel
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.java.lang.Exception
- if the method fails. Different elevation models may fail for different reasons.java.lang.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 boolean contains(Angle latitude, Angle longitude)
ElevationModel
latitude
- the latitude of the location in question.longitude
- the longitude of the location in question.public boolean containsElevationModel(ElevationModel em)
em
- the ElevationModel to test.java.lang.IllegalArgumentException
- if the ElevationModel is null.public void dispose()
Disposable
dispose
in interface Disposable
dispose
in class AbstractElevationModel
protected double[] doGetElevations(Sector sector, java.util.List<? extends LatLon> latlons, double[] targetResolution, double[] buffer, boolean mapMissingData)
public double getBestResolution(Sector sector)
ElevationModel
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.public double[] getBestResolutions(Sector sector)
getBestResolutions
in interface ElevationModel
getBestResolutions
in class AbstractElevationModel
public double getDetailHint(Sector sector)
ElevationModel
getDetailHint
in interface ElevationModel
getDetailHint
in class AbstractElevationModel
sector
- the sector in question.public java.util.List<ElevationModel> getElevationModels()
public double[] getElevations(Sector sector, java.util.List<? extends LatLon> latLons, double[] targetResolutions, double[] elevations)
ElevationModel
getElevations
in interface ElevationModel
getElevations
in class AbstractElevationModel
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 getElevations(Sector sector, java.util.List<? extends LatLon> latlons, double targetResolution, double[] buffer)
NOTE: This method returns only unmapped elevations if the compound model contains more than one elevation model. This enables the compound model's lower resolution elevation models to specify missing data values for the higher resolution elevation models.
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.ElevationModel.setMissingDataSignal(double)
public double[] getExtremeElevations(Angle latitude, Angle longitude)
ElevationModel
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.public double[] getExtremeElevations(Sector sector)
ElevationModel
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.public double getLocalDataAvailability(Sector sector, java.lang.Double targetResolution)
ElevationModel
getLocalDataAvailability
in interface ElevationModel
getLocalDataAvailability
in class AbstractElevationModel
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 getMaxElevation()
ElevationModel
public double getMinElevation()
ElevationModel
public double getUnmappedElevation(Angle latitude, Angle longitude)
ElevationModel
latitude
- the latitude of the location for which to return the elevation.longitude
- the longitude of the location for which to return the elevation.public double[] getUnmappedElevations(Sector sector, java.util.List<? extends LatLon> latLons, double[] targetResolutions, double[] elevations)
ElevationModel
getUnmappedElevations
in interface ElevationModel
getUnmappedElevations
in class AbstractElevationModel
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 getUnmappedElevations(Sector sector, java.util.List<? extends LatLon> latlons, double targetResolution, double[] buffer)
NOTE: This method returns only unmapped elevations if the compound model contains more than one elevation model. This enables the compound model's lower resolution elevation models to specify missing data values for the higher resolution elevation models.
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.ElevationModel.setMissingDataSignal(double)
public double getUnmappedLocalSourceElevation(Angle latitude, Angle longitude)
BasicElevationModel
.getUnmappedLocalSourceElevation
in interface ElevationModel
getUnmappedLocalSourceElevation
in class AbstractElevationModel
latitude
- The latitude of the location whose elevation is desired.longitude
- The longitude of the location whose elevation is desired.AbstractElevationModel.getMissingDataSignal()
).public int intersects(Sector sector)
ElevationModel
sector
- the sector in question.public boolean isExtremesCachingEnabled()
ElevationModel
ElevationModel.setExtremesCachingEnabled(boolean)
public void removeElevationModel(ElevationModel em)
public void removeElevationModel(int index)
public void setElevationModel(int index, ElevationModel em)
public void setExpiryTime(long expiryTime)
setExpiryTime
in interface ElevationModel
setExpiryTime
in class AbstractElevationModel
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 setExtremesCachingEnabled(boolean enabled)
ElevationModel
enabled
- true if extreme value caching should be performed.public void setNetworkRetrievalEnabled(boolean networkRetrievalEnabled)
ElevationModel
setNetworkRetrievalEnabled
in interface ElevationModel
setNetworkRetrievalEnabled
in class AbstractElevationModel
networkRetrievalEnabled
- true
if network retrieval is allowed, else false
.protected void sortElevationModels()