Class TerrainIntersections


  • public class TerrainIntersections
    extends ApplicationTemplate
    Shows how to compute terrain intersections using the highest resolution terrain data available from a globe's elevation model.

    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

    • Field Detail

      • GRID_RADIUS

        protected static final Angle GRID_RADIUS
        The width and height in degrees of the grid used to calculate intersections.
      • GRID_DIMENSION

        protected static final int GRID_DIMENSION
        The number of cells along each edge of the grid.
        See Also:
        Constant Field Values
      • TARGET_RESOLUTION

        protected static final java.lang.Double TARGET_RESOLUTION
        The desired terrain resolution to use in the intersection calculations.
    • Constructor Detail

      • TerrainIntersections

        public TerrainIntersections()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)