Howto:Use Terragear on Windows

From FlightGear wiki
Revision as of 17:42, 18 March 2009 by Stuart (Talk | contribs)

Jump to: navigation, search
Merge-arrows.gif
It has been suggested that this article or section be merged with Using the Custom Scenery TerraGear Toolset.
Merge-arrows.gif
It has been suggested that this article or section be merged with Using Terragear.

This article is under development, please wait a few days so I can finish this article.

This howto describes the procedure you might follow when using Terragear on a Windows machine. If you run Unix, check the Using the Custom Scenery TerraGear Toolset-article.

Installing

  1. Download the latest TerraGear-cs-Win32-....zip file from ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/.
  2. Unzip the package into a directory named Terragear/.
TerraGear Process Flow Chart

Elevation

The best elevation data currently available is from the Shuttle Radar Topography Mission (SRTM). There are two types of SRTM data:

  • Highly accurate 1-arcsecond resolution data, known as SRTM-1, for the USA
  • Less accurate 3-arcsecond data, known as SRTM-3, for the rest of the world.

From now on, we'll assume you are using SRTM-3 data. Unless otherwise noted, the process for SRTM-1 is identical.

You can get download the appropriate data from ftp://e0srp01u.ecs.nasa.gov/srtm. You want all .hgt.zip files covering your region of interest. Depending on the size of your scenery, there may be quite a few. Download them to data/SRTM-3.

Now we've got the data, we need to convert it into something of use to TerraGear. First, you need to unzip each of the .hgt files. Open the commandline (Run > cmd.exe) and type this:

C:/Users/AS9423-ULT/Desktop/Terragear/hgtchop.exe 3 C:/Users/AS9423-ULT/Desktop/Amsterdam/work/SRT2M-Eurasia-3

Now you will get a lot of .arr.gz files in your work/SRT2M-Eurasia-3/ directory. We need to convert these to the .fit.gz format. Run the commandline again with (NOTE: the space and dot at the and are important!):

C:/Users/AS9423-ULT/Desktop/Terragear/terrafit.exe .

That's the elevation done.

Airports

Now we've got elevation data, we can generate our airports.

First set the commandprompt to run from your work directory:

cd /Users/AS9423-ULT/Desktop/Amsterdam/work/

The command to create airports is "genapts". Run it without any arguments to see the various command-line options. If it is simply run with a specified apt.dat and work directory, it will generate airport layouts for every airport in the file, which can take a long time.

C:/Users/AS9423-ULT/Desktop/Terragear/genapts.exe --input=D:/FlightGear/data/Airports/apt.dat.gz --work=. --chunk=e004n52

If you are generating a larger set of scenery, then you can specify the minimum and maximum longitude and latitude. Genapts will create two sub-directories in your work directory - AirportArea and AirportObj. These define the definitions of the airport layout and any objects present (e.g. windsocks).

Right, that's the airports sorted out.

Land use

You now need to decode these into TerraGear format. This is done with the shape-decode command. There are three important command-line arguments to shape-decode:

  • the filename of the shapefile (without the .shp extension) you want to decode
  • the directory you want to write the data to
  • the material type to use.

Each of the shapefiles maps onto one of the material types defined in your materials.xml files. The mapping is pretty obvious, e.g. v0_mixedcroppasturecover maps to MixedCropPastureCover. Note that the material types are case-sensitive, so it is a good idea to have your materials.xml file to hand so you can check. The exception is v0_landmass, which MUST be mapped onto the type Default.

Additionally, there are a number of optional arguments, to indicate the width of line data (for roads, streams, railways), how large to make point data (for towns) and how long the longest straight line is allowed to be.

C:\Users\AS9423-ULT\Desktop\Terragear\shape-decode.exe --line-width 10 --continue-on-errors --max-segment 1000 
osm_rail C:\Users\AS9423-ULT\Desktop\Amsterdam\work\osm_rail Railroad
C:\Users\AS9423-ULT\Desktop\Terragear\shape-decode.exe --line-width 25 --continue-on-errors --max-segment 1000 
osm_motorway C:\Users\AS9423-ULT\Desktop\Amsterdam\work\osm_motorway Freeway

Related content