TerraGear

TerraGear is the scenery generation toolchain behind FlightGear: it turns public elevation and map data into the terrain tiles the simulator loads.

Shaded relief of San Francisco Bay: the peninsula on the left, the bay
       in the centre, the East Bay hills on the right.
San Francisco Bay, from the SRTM elevation data that feeds a TerraGear build. This one degree square is the worked example throughout this site; see the first-scenery guide and the measured build times.

What it does

TerraGear reads the kinds of geographic data that governments and research bodies publish openly, and turns them into terrain you can fly over.

What goes in: DEM terrain grids for elevation; 2D polygon data sets such as coastlines, city outlines and lake outlines; and 2D raster data sets such as kilometre-scale NOAA land cover. It also reads FAA data to build airports.

What comes out: FlightGear scenery tiles; terrain with landmass, water and land cover in place, together with airports, runways and runway lighting.

Four tools do it, in order. Each has a reference page here, written from a build that was run rather than from the source:

  1. hgtchop and terrafit elevation grids become a fitted mesh
  2. ogr-decode vector land cover becomes polygons the builder reads
  3. genapts airports, runways and lighting from apt.dat
  4. tg-construct the pieces become terrain, and the stage you size a machine for

What the output looks like

One square in three states, and then a different one. Nothing below is a photograph or a mock-up; the whole set, with the runs that produced it, is in the gallery.

Start here

If you have never built scenery before, follow one path from beginning to end rather than reading around:

  1. Install TerraGear Get the tools built on your machine.
  2. Build your first scenery tile One ordered route from an empty directory to terrain you can load.
  3. Browse the guides Data sources, build times, and what to do when something fails.

What to expect before you start

Scale is the only thing that really decides what a build costs, and the two ends of the range are further apart than the documentation suggests. The README warns of gigabytes and weeks, and that is honest: for the whole planet. The square above took 37 seconds and 11 MB.

Start small; the numbers, the hardware they were measured on and what moves them are on Hardware and build times. For builds that really are large, the terrain builder can be spread across a cluster of workstations.

The tools move: a branch that built last month may not build today. What was true when these pages were written, and when it was last checked, is on Upstream watch.

This is a demonstration build, pending review by the TerraGear team. Where the project’s own documentation is unclear or disagrees with itself, the page says so and marks it an open question rather than picking an answer quietly. Every figure comes from one recorded build.