Working with Terrain

Top  Previous  Next

The Terrain object can be added to a Mission Plan for use in the visualization and analysis of terrain features with Spacecraft and GroundVehicle objects. This object can be used to load high-resolution terrain data files of specific areas of interest or of the entire globe to determine line-of-sight visibility between any two objects orbiting in space, stationary anywhere, or moving on the ground. Once the terrain data has been loaded, you can query the elevation at a specified latitude and longitude contained within the data file.

 

The Terrain object also allows you to visualize and perform a viewshed analysis or determine the viewshed experienced over a period of time. When performing viewshed analyses with the Terrain object, you have the ability to model any number of any type of observers (Spacecraft, GroundVehicle, or GroundStation objects) to create a single-observer viewshed or a combined viewshed that takes all objects' visibility into account. If a GroundVehicle is used with the Terrain object, you could set it to use waypoints or a heading and have it automatically follow the terrain elevation.

 

 

Terrain Visualzation using a PointGroup

Terrain Visualzation using a PointGroup

 

 

Using the Terrain Object


A Terrain object can be defined by using the Terrain object editor or through FreeFlyer script. When defining the Terrain object, it will require terrain data to be loaded using one of the approved terrain data file formats that has already been processed by the Terrain Index Generator.

 

Defining Terrain with the Object Editor

To define the Terrain object within the object browser, use the Terrain object editor. The Terrain object editor contains a properties page that allows you to load any number of Terrain Data Files, also known as raster files.

 

Terrain Object Editor

Terrain Object Editor

 

Defining Terrain with FreeFlyer Script

The Terrain object can also be created using the FreeForm script editor. To define a Terrain object in FreeFlyer script, specify the terrain data file path(s) or directory.

 

Adding Terrain to a VisibilitySegment

The Terrain object can be added to or removed from a VisibilitySegment in order to define the surface features that will be considered when determining if the observer can see the target. The VisibilitySegment also allows you to compute and visualize a viewshed, by configuring a PointGroup that represents the target points. When including occulting terrain, you must model occulting bodies as ellipsoids using the VisibilitySegment.CelestialObjectOccultationModel property.

 

 

 

Terrain Data


Terrain data is typically represented as a collection of data files or “tiles”. Individual tiles can cover a relatively small area, such as 1° by 1° of latitude/longitude. The most common terrain data file formats are GEOTiff, which are specialized image files encoded with elevation data, and binary Digital Terrain Elevation Data (DTED).

These collections of tiles are called terrain data sets. The most complete and commonly available terrain data sets are GTOPO30, SRTM, and NED.

 

Source

Coverage

Resolutions

GTOPO30

Global

30 arc-seconds (approximately 1 kilometer)

SRTM (Shuttle Radar Topography Mission)

Global

*Only -60 deg to 60 deg Latitude

3 arc-seconds (approximately 90 meters)

1 arc-second  (approximately 30 meters)

NED (National Elevation Dataset)

United States

1    arc-second (approx. 30 meters)

1/3 arc-second (approx. 10 meters)

1/9 arc-second (approx. 3 meters) *In Limited Areas

 

Additional information on these terrain data sets and other supported file formats can be found on the Terrain Data Files page.

 

All terrain data to be used with the Terrain object must be pre-processed using the Terrain Index Generator command line utility. When generating terrain index files using the Terrain Index Generator utility, you have the ability to specify the vertical datum as EGM96 or WGS84. The Terrain object only supports Earth-based terrain tiles at this time.

 

Terrain Index Files

The purpose of the FreeFlyer terrain index file is to help increase query performance when evaluating line-of-sight calculations involving Terrain using a VisibilitySegment object. At runtime, FreeFlyer will check for a corresponding terrain index file to an accessed terrain file by searching the same directory for the terrain's same filename but with an .ffidx suffix. If there is no corresponding terrain index file to the accessed terrain data, FreeFlyer will throw a runtime error. This error can be resolved by using the Terrain Index Generator utility to create an appropriate terrain index file.

 

Terrain data and index files must be locally accessible. Each time terrain data is queried for terrain height or a terrain index is queried for a line-of-sight intersection, there are multiple reads that are made to the disk. It is possible to access this data over a network share, but any additional network-induced latency could potentially degrade FreeFlyer’s performance.

 

Terrain Data Visualization

PointGroups and GraphicsOverlay objects can be used to visualize Terrain Data Files. See the Terrain Visualization Sample Mission Plan for a working example.

 

Terrain Data Files are often represented as rasters, which are digital images such as aerial photographs, satellite imagery, or scanned maps. Geographic information systems (GIS) data is commonly stored in a raster format to encode geographic data as the pixel values. Rasters are well suited for representing data that changes continuously across a surface, such as with topography. The following raster data displays elevation using blue to show lower elevation and green, yellow, and red shading to show higher elevations.

 

Raster Data for Mount Rushmore

Raster Data for Mount Rushmore

 

Terrain Data Interpolation

The Terrain object will use double-linear interpolation when querying a height located between two data points in a raster file and when determining line-of-sight intersections with terrain. This is accomplished by computing the height of a point as the average from four corners that use individual pixels contained within the terrain raster file. This is demonstrated in the following image where FreeFlyer uses double-linear interpolation to form the four triangles and visualize them with a PointGroup.

 

Four triangles Terrain Double-linear Interpolation Method

Four triangles Terrain Double-linear Interpolation Method

 

Example: Determining Height at a Latitude/Longitude


In this example, the height at a specific Latitude/Longitude is reported.

 

 

 

Example: Set/Get GroundStation Height using Terrain


In this example, the height for a GroundStation is set and reported using the Terrain object. This example sets the GroundStation height at 3 meters above the Terrain height using the GroundStation.SetHeight() method to prevent erroneous visibility evaluations.

 

 

Note: If an object's height is set at 0 km with the SetHeight() method, the Visibility could be returned as true or false due to the object being exactly on the border of the occultation.

 

 

Example: Propagate GroundVehicle to follow Terrain


In this example, a GroundVehicle object follows a path designated by waypoints and adjust the GroundVehicle height based on the Terrain object. This example sets the GroundVehicle height at 2 meters above the Terrain height using the GroundVehicle.SetHeight() method to prevent erroneous visibility evaluations. After using the GroundVehicle.SetReferenceTerrain() method the GroundVehicle will maintain a constant height with respect to the reference terrain, and will report an error if you try to move the GroundVehicle outside the terrain. To prevent the error, you can confirm whether a GroundVehicle's location is within the Terrain data by using the Terrain.ContainsLocation() method.

 

 

Plot of GroundVehicle height when using a reference Terrain

Plot of GroundVehicle height when using a reference Terrain

 

 

Example: Determining Visibility between a Spacecraft and GroundStation


In this example, a Terrain object is created to model the Grand Canyon's occultation for a VisibilitySegment between a GroundStation and a Spacecraft. It then plots the contact with and without Terrain occultation included. The GroundStation is located on the floor of a valley with the height set using the Terrain object.

 

 

Plot of GroundStation Visibility with and without Terrain occultation 

Plot of GroundStation Visibility with and without Terrain occultation 

 

 

See Also


Terrain Properties and Methods

GroundVehicle Guide

Contact Method Summary