public class TerrainIntersections extends ApplicationTemplate
To generate and show intersections, Shift + LeftClick anywhere on the globe. The program forms a grid of locations around the selected location. The grid points are shown in yellow. It then determines whether a line between the selected location and each grid point intersects the terrain. If it does, the intersection nearest the selected location is shown in cyan and a line is drawn from the selected location to the intersection. If there is no intersection, a line is drawn from the selected location to the grid position.
If the highest resolution terrain is not available for the area around the selected location, it is retrieved from the elevation model's source, which is most likely a remote server. Since the high-res data must be retrieved and then loaded from the local disk cache, it will take some time to compute and show the intersections.
This example uses a Terrain
object to perform the terrain retrieval, generation
and intersection calculations.s
Modifier and Type | Class and Description |
---|---|
static class |
TerrainIntersections.AppFrame |
ApplicationTemplate.AppPanel
Modifier and Type | Field and Description |
---|---|
protected static int |
GRID_DIMENSION
The number of cells along each edge of the grid.
|
protected static Angle |
GRID_RADIUS
The width and height in degrees of the grid used to calculate intersections.
|
protected static int |
NUM_THREADS |
protected static java.lang.Double |
TARGET_RESOLUTION
The desired terrain resolution to use in the intersection calculations.
|
Constructor and Description |
---|
TerrainIntersections() |
Modifier and Type | Method and Description |
---|---|
static void |
main(java.lang.String[] args) |
insertAfterPlacenames, insertBeforeCompass, insertBeforeLayerName, insertBeforePlacenames, start
protected static final int GRID_DIMENSION
protected static final Angle GRID_RADIUS
protected static final int NUM_THREADS
protected static final java.lang.Double TARGET_RESOLUTION