NASA World Wind

gov.nasa.worldwind.terrain
Class HighResolutionTerrain

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.terrain.HighResolutionTerrain
All Implemented Interfaces:
AVList, MessageListener, Terrain, WWObject, PropertyChangeListener, EventListener

public class HighResolutionTerrain
extends WWObjectImpl
implements Terrain

Provides operations on the best available terrain. Operations such as line/terrain intersection and surface point computation use the highest resolution terrain data available from the globe's elevation model. Because the best available data may not be available when the operations are performed, the operations block while they retrieve the required data from either the local disk cache or a remote server. A timeout may be specified to limit the amount of time allowed for retrieving data. Operations fail if the timeout is exceeded.


Nested Class Summary
static interface HighResolutionTerrain.IntersectionCallback
          Defines an interface for returning computed intersections.
protected static class HighResolutionTerrain.RectTile
          Defines an internal terrain tile.
protected static class HighResolutionTerrain.RenderInfo
          Holds a tile's geometry.
 
Field Summary
protected static long DEFAULT_CACHE_CAPACITY
           
protected static int DEFAULT_DENSITY
           
protected  int density
           
protected  MemoryCache geometryCache
           
protected  Globe globe
           
protected  double latTileSize
           
protected  double lonTileSize
           
protected  int numCols
           
protected  int numRows
           
protected  Sector sector
           
protected  ThreadLocal<Long> startTime
           
protected  double targetResolution
           
protected  MemoryCache tileCache
           
protected  Long timeout
           
protected  double verticalExaggeration
           
 
Constructor Summary
HighResolutionTerrain(Globe globe, Double targetResolution)
          Constructs a terrain object for a specified globe.
HighResolutionTerrain(Globe globe, Sector sector, Double targetResolution, Double verticalExaggeration)
          Constructs a terrain object for a specified sector of a specified globe.
 
Method Summary
protected  Vec4 applyOffset(Vec4 point, double metersOffset)
          Applies a specified vertical offset to a surface point.
protected  HighResolutionTerrain.RenderInfo buildVerts(HighResolutionTerrain.RectTile tile)
          Computes a terrain tile's vertices.
 void cacheIntersectingTiles(Position pA, Position pB)
          Cause the tiles used by subsequent intersection calculations to be cached so that they are available immediately to those subsequent calculations.
 void cacheIntersectingTiles(Sector sector)
          Cause the tiles used by subsequent intersection calculations to be cached so that they are available immediately to those subsequent calculations.
protected  int computeColumn(Sector range, Angle longitude)
          Computes the column index corresponding to a specified latitude.
protected  void computeDimensions()
          Computes the row and column dimensions of the tile array.
protected  ArrayList<LatLon> computeLocations(HighResolutionTerrain.RectTile tile)
          Computes the tile's cell locations, determined by the tile's density and sector.
protected  int computeRow(Sector range, Angle latitude)
          Computes the row index corresponding to a specified latitude.
protected  void convertPointsToPositions(List<Vec4[]> points, List<Position[]> positions)
           
protected static double createPosition(int start, double decimal, int density)
           
protected  HighResolutionTerrain.RectTile createTile(int row, int col)
          Creates a tile for a specified row and column of the tile array.
protected  HighResolutionTerrain.RectTile createTile(Sector tileSector)
          Creates the tile for a specified sector.
protected  Intersection[] doIntersect(Position pA, Position pB)
          Computes intersections of a line with the terrain.
protected  List<HighResolutionTerrain.RectTile> eliminateLowAltitudeTiles(List<HighResolutionTerrain.RectTile> tiles, double minAltitude)
           
 long getCacheCapacity()
          Indicates the current cache capacity.
 double getCacheUsage()
          Indicates the proportion of the cache currently used.
protected  HighResolutionTerrain.RectTile getContainingTile(Angle latitude, Angle longitude)
          Determines the tile that contains a specified location.
 int getDensity()
           
 Double getElevation(LatLon location)
          Computes the elevation at a specified location.
protected  double getElevations(Sector sector, List<LatLon> latlons, double targetResolution, double[] elevations)
           
 Position[] getExtremeElevations(LatLon center, double width, double height)
          Determines the minimum and maximum elevations and their locations within a specified geographic quadrilateral.
 Position[] getExtremeElevations(Sector sector)
          Determines the minimum and maximum elevations and their locations within a specified Sector.
 Globe getGlobe()
          Returns the object's globe.
protected  Set<HighResolutionTerrain.RectTile> getIntersectingTiles(LatLon pA, LatLon pB)
          Determines and creates the terrain tiles intersected by a specified line.
protected  List<HighResolutionTerrain.RectTile> getIntersectingTiles(Sector sector)
           
 List<Sector> getIntersectionTiles(Position pA, Position pB)
           
 int getNumCacheEntries()
          Returns the number of entries currently in the cache.
 Sector getSector()
          Returns the object's sector.
 Vec4 getSurfacePoint(Angle latitude, Angle longitude, double metersOffset)
          Computes the Cartesian, model-coordinate point of a location on the terrain.
protected  Vec4 getSurfacePoint(HighResolutionTerrain.RectTile tile, Angle latitude, Angle longitude)
          Computes the Cartesian, model-coordinate point of a location within a terrain tile.
protected  Vec4 getSurfacePoint(HighResolutionTerrain.RectTile tile, Angle latitude, Angle longitude, double metersOffset)
          Computes the Cartesian, model-coordinate point of a location within a terrain tile.
 Vec4 getSurfacePoint(Position position)
          Computes the Cartesian, model-coordinate point of a position on the terrain.
 double getTargetResolution()
           
 Long getTimeout()
          Indicates the current timeout for operations requiring terrain data retrieval.
 double getVerticalExaggeration()
          Indicates the vertical exaggeration used when performing terrain operations.
protected static Vec4 interpolate(int row, int column, double xDec, double yDec, HighResolutionTerrain.RenderInfo ri)
           
protected static Vec4 interpolate(Vec4 bL, Vec4 bR, Vec4 tR, Vec4 tL, double xDec, double yDec)
           
protected  Intersection[] intersect(HighResolutionTerrain.RectTile tile, Line line)
          Computes the intersections of a line with a tile.
protected  List<Vec4[]> intersect(HighResolutionTerrain.RectTile tile, Vec4[] triangle)
          Computes the intersection of a triangle with a terrain tile.
 Intersection[] intersect(Line line)
          Intersect a line with the terrain.
 void intersect(List<Position> positions, HighResolutionTerrain.IntersectionCallback callback)
          Intersects a specified list of geographic two-position lines with the terrain.
 Intersection[] intersect(Position pA, Position pB)
          Computes the intersections of a line with the terrain.
 Intersection[] intersect(Position pA, Position pB, int altitudeMode)
          Computes the intersections of a line with the terrain.
 void intersectTriangle(Vec4[] triangleCoordinates, Position[] trianglePositions, List<Position[]> intersectPositionsOut)
          Intersects a specified triangle with the terrain.
protected  void makeVerts(HighResolutionTerrain.RectTile tile)
          Computes a terrain tile's vertices of draws them from the cache.
 void setCacheCapacity(long size)
          Specifies the cache capacity.
 void setDensity(int density)
          Specifies the number of intervals within a single terrain tile.
 void setTimeout(Long timeout)
          Specifies the maximum amount of time allowed for retrieval of all terrain data necessary to satisfy an operation.
 
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, finalize, getClass, hashCode, notify, notifyAll, toString, 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
 

Field Detail

DEFAULT_CACHE_CAPACITY

protected static final long DEFAULT_CACHE_CAPACITY
See Also:
Constant Field Values

DEFAULT_DENSITY

protected static final int DEFAULT_DENSITY
See Also:
Constant Field Values

density

protected int density

geometryCache

protected MemoryCache geometryCache

globe

protected Globe globe

latTileSize

protected double latTileSize

lonTileSize

protected double lonTileSize

numCols

protected int numCols

numRows

protected int numRows

sector

protected Sector sector

startTime

protected ThreadLocal<Long> startTime

targetResolution

protected double targetResolution

tileCache

protected MemoryCache tileCache

timeout

protected Long timeout

verticalExaggeration

protected double verticalExaggeration
Constructor Detail

HighResolutionTerrain

public HighResolutionTerrain(Globe globe,
                             Double targetResolution)
Constructs a terrain object for a specified globe.

Parameters:
globe - the terrain's globe.
targetResolution - the target terrain resolution, in meters, or null to use the globe's highest resolution.
Throws:
IllegalArgumentException - if the globe is null.

HighResolutionTerrain

public HighResolutionTerrain(Globe globe,
                             Sector sector,
                             Double targetResolution,
                             Double verticalExaggeration)
Constructs a terrain object for a specified sector of a specified globe.

Parameters:
globe - the terrain's globe.
sector - the desired range for the terrain. Only locations within this sector may be used in operations. If null, the sector spans the entire globe.
targetResolution - the target terrain resolution, in meters, or null to use the globe's highest resolution.
verticalExaggeration - the vertical exaggeration to apply to terrain elevations. Null indicates no exaggeration.
Throws:
IllegalArgumentException - if the globe is null.
Method Detail

applyOffset

protected Vec4 applyOffset(Vec4 point,
                           double metersOffset)
Applies a specified vertical offset to a surface point.

Parameters:
point - the surface point.
metersOffset - the vertical offset to add to the point.
Returns:
a new point offset the specified amount from the input point.

buildVerts

protected HighResolutionTerrain.RenderInfo buildVerts(HighResolutionTerrain.RectTile tile)
                                               throws InterruptedException
Computes a terrain tile's vertices.

Parameters:
tile - the tile to compute vertices for
Returns:
the computed vertex information.
Throws:
InterruptedException - if the operation is interrupted.
WWTimeoutException - if terrain data retrieval exceeds the current timeout.

cacheIntersectingTiles

public void cacheIntersectingTiles(Position pA,
                                   Position pB)
                            throws InterruptedException
Cause the tiles used by subsequent intersection calculations to be cached so that they are available immediately to those subsequent calculations.

Pre-caching is unnecessary and is useful only when it can occur before the intersection calculations are needed. It will incur extra overhead otherwise. The normal intersection calculations cause the same caching.

Parameters:
pA - the line's first position.
pB - the line's second position.
Throws:
IllegalArgumentException - if either position is null.
InterruptedException - if the operation is interrupted. if the current timeout is exceeded while retrieving terrain data.

cacheIntersectingTiles

public void cacheIntersectingTiles(Sector sector)
                            throws InterruptedException
Cause the tiles used by subsequent intersection calculations to be cached so that they are available immediately to those subsequent calculations.

Pre-caching is unnecessary and is useful only when it can occur before the intersection calculations are needed. It will incur extra overhead otherwise. The normal intersection calculations cause the same caching.

Parameters:
sector - the sector for which to cache elevation data.
Throws:
IllegalArgumentException - if the specified sector is null.
InterruptedException - if the operation is interrupted. if the current timeout is exceeded while retrieving terrain data.

computeColumn

protected int computeColumn(Sector range,
                            Angle longitude)
Computes the column index corresponding to a specified latitude.

Parameters:
range - the reference sector, typically that of this terrain instance.
longitude - the latitude in question.
Returns:
the column index for the sector.

computeDimensions

protected void computeDimensions()
Computes the row and column dimensions of the tile array.


computeLocations

protected ArrayList<LatLon> computeLocations(HighResolutionTerrain.RectTile tile)
Computes the tile's cell locations, determined by the tile's density and sector.

Parameters:
tile - the tile to compute locations for.
Returns:
the cell locations.

computeRow

protected int computeRow(Sector range,
                         Angle latitude)
Computes the row index corresponding to a specified latitude.

Parameters:
range - the reference sector, typically that of this terrain instance.
latitude - the latitude in question.
Returns:
the row index for the sector.

convertPointsToPositions

protected void convertPointsToPositions(List<Vec4[]> points,
                                        List<Position[]> positions)

createPosition

protected static double createPosition(int start,
                                       double decimal,
                                       int density)

createTile

protected HighResolutionTerrain.RectTile createTile(int row,
                                                    int col)
Creates a tile for a specified row and column of the tile array.

Parameters:
row - the tile's 0-origin row index.
col - the tile's 0-origin column index.
Returns:
the tile for the specified row and column, or null if the row or column are invalid.

createTile

protected HighResolutionTerrain.RectTile createTile(Sector tileSector)
Creates the tile for a specified sector.

Parameters:
tileSector - the sector for which to create the tile.
Returns:
the tile for the sector, or null if the sector is outside this instance's sector.

doIntersect

protected Intersection[] doIntersect(Position pA,
                                     Position pB)
                              throws InterruptedException
Computes intersections of a line with the terrain.

Parameters:
pA - the line's first position.
pB - the line's second position.
Returns:
an array of intersections, or null if no intersections occur.
Throws:
InterruptedException - if the operation is interrupted.

eliminateLowAltitudeTiles

protected List<HighResolutionTerrain.RectTile> eliminateLowAltitudeTiles(List<HighResolutionTerrain.RectTile> tiles,
                                                                         double minAltitude)
                                                                  throws InterruptedException
Throws:
InterruptedException

getCacheCapacity

public long getCacheCapacity()
Indicates the current cache capacity.

Returns:
the current cache capacity, in bytes.

getCacheUsage

public double getCacheUsage()
Indicates the proportion of the cache currently used.

Returns:
the fraction of the cache currently used: a number between 0 and 1.

getContainingTile

protected HighResolutionTerrain.RectTile getContainingTile(Angle latitude,
                                                           Angle longitude)
Determines the tile that contains a specified location.

Parameters:
latitude - the location's latitude.
longitude - the location's longitude.
Returns:
the tile containing the specified location.

getDensity

public int getDensity()

getElevation

public Double getElevation(LatLon location)
Computes the elevation at a specified location.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Specified by:
getElevation in interface Terrain
Parameters:
location - the location at which to compute the elevation.
Returns:
the elevation at the location, or null if the elevation could not be determined.

getElevations

protected double getElevations(Sector sector,
                               List<LatLon> latlons,
                               double targetResolution,
                               double[] elevations)
                        throws InterruptedException
Throws:
InterruptedException

getExtremeElevations

public Position[] getExtremeElevations(LatLon center,
                                       double width,
                                       double height)
                                throws InterruptedException
Determines the minimum and maximum elevations and their locations within a specified geographic quadrilateral.

Parameters:
center - The quadrilateral's center.
width - The quadrilateral's longitudinal width, in meters.
height - The quadrilateral's latitudinal height, in meters.
Returns:
a two-element array containing the minimum and maximum elevations and their locations in the quadrilateral. The minimum as at index 0 in the array, the maximum is at index 1. If either cannot be determined, null is given in the respective array position.
Throws:
InterruptedException - if the operation is interrupted before it completes.

getExtremeElevations

public Position[] getExtremeElevations(Sector sector)
                                throws InterruptedException
Determines the minimum and maximum elevations and their locations within a specified Sector.

Parameters:
sector - The sector in question.
Returns:
a two-element array containing the minimum and maximum elevations and their locations in the sector. The minimum as at index 0 in the array, the maximum is at index 1. If either cannot be determined, null is given in the respective array position.
Throws:
InterruptedException - if the operation is interrupted before it completes.

getGlobe

public Globe getGlobe()
Returns the object's globe.

Specified by:
getGlobe in interface Terrain
Returns:
the globe specified to the constructor.

getIntersectingTiles

protected Set<HighResolutionTerrain.RectTile> getIntersectingTiles(LatLon pA,
                                                                   LatLon pB)
Determines and creates the terrain tiles intersected by a specified line.

Parameters:
pA - the line's first position.
pB - the line's second position.
Returns:
a list of tiles that likely intersect the line. Some returned tiles may not intersect the line but will only be near it.

getIntersectingTiles

protected List<HighResolutionTerrain.RectTile> getIntersectingTiles(Sector sector)

getIntersectionTiles

public List<Sector> getIntersectionTiles(Position pA,
                                         Position pB)

getNumCacheEntries

public int getNumCacheEntries()
Returns the number of entries currently in the cache.

Returns:
the number of entries currently in the cache.s

getSector

public Sector getSector()
Returns the object's sector.

Returns:
the object's sector, either the sector specified at construction or the default sector if no sector was specified at construction.

getSurfacePoint

public Vec4 getSurfacePoint(Angle latitude,
                            Angle longitude,
                            double metersOffset)
Computes the Cartesian, model-coordinate point of a location on the terrain.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Specified by:
getSurfacePoint in interface Terrain
Parameters:
latitude - the location's latitude.
longitude - the location's longitude.
metersOffset - the location's distance above the terrain.
Returns:
the Cartesian, model-coordinate point of the specified location, or null if the specified location does not exist within this instance's sector or if the operation is interrupted.

getSurfacePoint

protected Vec4 getSurfacePoint(HighResolutionTerrain.RectTile tile,
                               Angle latitude,
                               Angle longitude)
                        throws InterruptedException
Computes the Cartesian, model-coordinate point of a location within a terrain tile.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Parameters:
tile - the terrain tile.
latitude - the location's latitude.
longitude - the location's longitude.
Returns:
the Cartesian, model-coordinate point of a the specified location, or null if the specified location does not exist within this instance's sector or if the operation is interrupted.
Throws:
IllegalArgumentException - if the latitude or longitude are null.
WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
InterruptedException - if the operation is interrupted.
See Also:
setTimeout(Long)

getSurfacePoint

protected Vec4 getSurfacePoint(HighResolutionTerrain.RectTile tile,
                               Angle latitude,
                               Angle longitude,
                               double metersOffset)
                        throws InterruptedException
Computes the Cartesian, model-coordinate point of a location within a terrain tile.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Parameters:
tile - the terrain tile.
latitude - the location's latitude.
longitude - the location's longitude.
metersOffset - the location's distance above the terrain.
Returns:
the Cartesian, model-coordinate point of a the specified location, or null if the specified location does not exist within this instance's sector or if the operation is interrupted.
Throws:
IllegalArgumentException - if the latitude or longitude are null.
WWTimeoutException - if the current timeout is exceeded while retrieving terrain data.
InterruptedException - if the operation is interrupted.
See Also:
setTimeout(Long)

getSurfacePoint

public Vec4 getSurfacePoint(Position position)
Computes the Cartesian, model-coordinate point of a position on the terrain.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Specified by:
getSurfacePoint in interface Terrain
Parameters:
position - the position.
Returns:
the Cartesian, model-coordinate point of the specified position, or null if the specified position does not exist within this instance's sector or if the operation is interrupted.

getTargetResolution

public double getTargetResolution()

getTimeout

public Long getTimeout()
Indicates the current timeout for operations requiring terrain data retrieval.

Returns:
the current timeout, in milliseconds. May be null.
See Also:
setTimeout(Long)

getVerticalExaggeration

public double getVerticalExaggeration()
Indicates the vertical exaggeration used when performing terrain operations.

Specified by:
getVerticalExaggeration in interface Terrain
Returns:
the vertical exaggeration. The default is 1: no exaggeration.

interpolate

protected static Vec4 interpolate(int row,
                                  int column,
                                  double xDec,
                                  double yDec,
                                  HighResolutionTerrain.RenderInfo ri)

interpolate

protected static Vec4 interpolate(Vec4 bL,
                                  Vec4 bR,
                                  Vec4 tR,
                                  Vec4 tL,
                                  double xDec,
                                  double yDec)

intersect

protected Intersection[] intersect(HighResolutionTerrain.RectTile tile,
                                   Line line)
                            throws InterruptedException
Computes the intersections of a line with a tile.

Parameters:
tile - the tile.
line - the line.
Returns:
an array of intersections, or null if no intersections occur.
Throws:
InterruptedException - if the operation is interrupted.

intersect

protected List<Vec4[]> intersect(HighResolutionTerrain.RectTile tile,
                                 Vec4[] triangle)
                          throws InterruptedException
Computes the intersection of a triangle with a terrain tile.

Parameters:
tile - the terrain tile
triangle - the Cartesian coordinates of the triangle.
Returns:
a list of the intersection points at which the triangle intersects the tile, or null if there are no intersections. If there are intersections, each entry in the returned list contains a two-element array holding the Cartesian coordinates of the intersection point with one terrain triangle. In the cases of co-planar triangles, all three vertices of the terrain triangle are returned, in a three-element array.
Throws:
InterruptedException - if the operation is interrupted before it completes.

intersect

public Intersection[] intersect(Line line)
Intersect a line with the terrain.

Note: This method produces a result only if the line is below the globe's horizon, i.e., it intersects the globe's ellipsoid. If the line is above the horizon, null is returned even if there is terrain in the path of the line.

Parameters:
line - the line to intersect
Returns:
an array of intersections with the terrain, or null if there are no intersections or the line is above the globe's horizon.

intersect

public void intersect(List<Position> positions,
                      HighResolutionTerrain.IntersectionCallback callback)
               throws InterruptedException
Intersects a specified list of geographic two-position lines with the terrain.

Parameters:
positions - The positions to intersect, with the line segments formed by each pair of positions, e.g. the first line in formed by positions[0] and positions[1], the second by positions[2] and positions[3], etc.
callback - An object to call in order to return the computed intersections.
Throws:
InterruptedException

intersect

public Intersection[] intersect(Position pA,
                                Position pB)
Computes the intersections of a line with the terrain. The line is specified by two positions whose altitude field indicates the height above the terrain (not the altitude relative to sea level). All intersection points are returned.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Specified by:
intersect in interface Terrain
Parameters:
pA - the line's first position.
pB - the line's second position.
Returns:
an array of Cartesian model-coordinate intersection points, or null if no intersections occur or the operation is interrupted.

intersect

public Intersection[] intersect(Position pA,
                                Position pB,
                                int altitudeMode)
Computes the intersections of a line with the terrain. The line is specified by two positions whose altitude field is interpreted according to the specified altitude mode. All intersection points are returned.

This operation fails with a WWTimeoutException if a timeout has been specified and it is exceeded during the operation.

Specified by:
intersect in interface Terrain
Parameters:
pA - the line's first position.
pB - the line's second position.
altitudeMode - the altitude mode indicating the reference for the altitudes in the specified positions.
Returns:
an array of Cartesian model-coordinate intersection points, or null if no intersections occur or the operation is interrupted.

intersectTriangle

public void intersectTriangle(Vec4[] triangleCoordinates,
                              Position[] trianglePositions,
                              List<Position[]> intersectPositionsOut)
                       throws InterruptedException
Intersects a specified triangle with the terrain.

Parameters:
triangleCoordinates - The Cartesian coordinates of the triangle.
trianglePositions - The geographic coordinates of the triangle.
intersectPositionsOut - A list in which to place the intersection positions. May not be null.
Throws:
InterruptedException - if the operation is interrupted before it completes.

makeVerts

protected void makeVerts(HighResolutionTerrain.RectTile tile)
                  throws InterruptedException
Computes a terrain tile's vertices of draws them from the cache.

Parameters:
tile - the tile to compute vertices for
Throws:
InterruptedException - if the operation is interrupted.
WWTimeoutException - if terrain data retrieval exceeds the current timeout.

setCacheCapacity

public void setCacheCapacity(long size)
Specifies the cache capacity.

Parameters:
size - the cache capacity, in bytes. Values less than 1 MB are clamped to 1 MB.

setDensity

public void setDensity(int density)
Specifies the number of intervals within a single terrain tile. Density does not affect precision, it just determines how many sample points to include with each internal terrain tile. The precision -- the distance between each sample point -- is governed by the terrain tolerance specified in this object's constructor.

Parameters:
density - the number of intervals used to form a terrain tile.

setTimeout

public void setTimeout(Long timeout)
Specifies the maximum amount of time allowed for retrieval of all terrain data necessary to satisfy an operation. Operations that retrieve data throw a WWTimeoutException if the specified timeout is exceeded.

Parameters:
timeout - the number of milliseconds to wait. May be null, to indicate that operations have unlimited amount of time to operate.

NASA World Wind