Package gov.nasa.worldwind.terrain
Class ZeroElevationModel
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.terrain.AbstractElevationModel
-
- gov.nasa.worldwind.terrain.ZeroElevationModel
-
- All Implemented Interfaces:
AVList,Disposable,MessageListener,ElevationModel,Restorable,WWObject,java.beans.PropertyChangeListener,java.util.EventListener
public class ZeroElevationModel extends AbstractElevationModel
An elevation model that always returns zero elevations.
-
-
Field Summary
-
Fields inherited from class gov.nasa.worldwind.terrain.AbstractElevationModel
dataFileStore, enabled, expiryTime, missingDataFlag, missingDataValue, networkRetrievalEnabled
-
-
Constructor Summary
Constructors Constructor Description ZeroElevationModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Angle latitude, Angle longitude)Indicates whether a specified location is within the elevation model's domain.doublegetBestResolution(Sector sector)Indicates the best resolution attainable for a specified sector.doublegetElevations(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.doublegetMaxElevation()Returns the maximum elevation contained in the elevation model.doublegetMinElevation()Returns the minimum elevation contained in the elevation model.doublegetUnmappedElevation(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.doublegetUnmappedElevations(Sector sector, java.util.List<? extends LatLon> latlons, double targetResolution, double[] buffer)Returns the elevations of a collection of locations.intintersects(Sector sector)Indicates whether the elevation model covers a specified sector either partially or fully.booleanisExtremesCachingEnabled()Indicates whether extreme value caching is enabled.voidsetExtremesCachingEnabled(boolean enabled)Indicates whether extreme values of sectors should be cached as they're computed.-
Methods inherited from class gov.nasa.worldwind.terrain.AbstractElevationModel
composeElevations, createElevationModelConfigElements, dispose, getBestResolutions, getDataFileStore, getDetailHint, getElevation, getElevationModelConfigParams, getElevations, getExpiryTime, getLocalDataAvailability, getMissingDataReplacement, getMissingDataSignal, getName, getRestorableState, getUnmappedElevations, getUnmappedLocalSourceElevation, isElevationModelConfigDocument, isEnabled, isNetworkRetrievalEnabled, isTransparentValue, restoreState, setDataFileStore, setEnabled, setExpiryTime, setMissingDataReplacement, setMissingDataSignal, setName, setNetworkRetrievalEnabled, toString
-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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 gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Method Detail
-
getMaxElevation
public double getMaxElevation()
Description copied from interface:ElevationModelReturns the maximum elevation contained in the elevation 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
public double getMinElevation()
Description copied from interface:ElevationModelReturns the minimum elevation contained in the elevation 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.
-
getExtremeElevations
public double[] getExtremeElevations(Angle latitude, Angle longitude)
Description copied from interface:ElevationModelReturns 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
doublearray 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.
-
getExtremeElevations
public double[] getExtremeElevations(Sector sector)
Description copied from interface:ElevationModelReturns the minimum and maximum elevations within a specified sector of the elevation model.- Parameters:
sector- the sector in question.- Returns:
- A two-element
doublearray 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.
-
getElevations
public double getElevations(Sector sector, java.util.List<? extends LatLon> latlons, double targetResolution, double[] buffer)
Description copied from interface:ElevationModelReturns the elevations of a collection of locations. Replaces any elevation values corresponding to the missing data signal with the elevation model's missing data replacement value. If a location within the elevation model's coverage area cannot currently be determined, the elevation model's minimum extreme elevation for that location is returned in the output buffer. If a location is outside the elevation model's coverage area, the output buffer for that location is not modified; it retains the buffer's original value.- Parameters:
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.- Returns:
- the resolution achieved, in radians, or
Double.MAX_VALUEif individual elevations cannot be determined for all of the locations. - See Also:
ElevationModel.setMissingDataSignal(double)
-
getUnmappedElevations
public double getUnmappedElevations(Sector sector, java.util.List<? extends LatLon> latlons, double targetResolution, double[] buffer)
Description copied from interface:ElevationModelReturns the elevations of a collection of locations. Does not replace any elevation values corresponding to the missing data signal with the elevation model's missing data replacement value. If a location within the elevation model's coverage area cannot currently be determined, the elevation model's minimum extreme elevation for that location is returned in the output buffer. If a location is outside the elevation model's coverage area, the output buffer for that location is not modified; it retains the buffer's original value.- Parameters:
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.- Returns:
- the resolution achieved, in radians, or
Double.MAX_VALUEif individual elevations cannot be determined for all of the locations. - See Also:
ElevationModel.setMissingDataSignal(double)
-
intersects
public int intersects(Sector sector)
Description copied from interface:ElevationModelIndicates whether the elevation model covers a specified sector either partially or fully.- 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 sector does not intersect the elevation model.
-
contains
public boolean contains(Angle latitude, Angle longitude)
Description copied from interface:ElevationModelIndicates 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
public double getBestResolution(Sector sector)
Description copied from interface:ElevationModelIndicates 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_VALUEif the sector does not intersect the elevation model.
-
getUnmappedElevation
public double getUnmappedElevation(Angle latitude, Angle longitude)
Description copied from interface:ElevationModelReturns the elevation at a specified location, but without replacing missing data with the elevation model's missing data replacement value. When a missing data signal is found, the signal value is returned, not the 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 in memory for the location, and the location is within the elevation model's coverage area, the elevation model's minimum elevation at that location is returned.
-
setExtremesCachingEnabled
public void setExtremesCachingEnabled(boolean enabled)
Description copied from interface:ElevationModelIndicates whether extreme values of sectors should be cached as they're computed. Caching should be disabled if especially many sectors are to be used when querying extreme elevations of this elevation model, such as during terrain intersection calculations. The default is for caching to be enabled. During normal operation caching enhances performance, but during terrain intersection computation it can hamper performance.- Parameters:
enabled- true if extreme value caching should be performed.
-
isExtremesCachingEnabled
public boolean isExtremesCachingEnabled()
Description copied from interface:ElevationModelIndicates whether extreme value caching is enabled.- Returns:
- true if extreme values caching is enabled, otherwise false.
- See Also:
ElevationModel.setExtremesCachingEnabled(boolean)
-
-