Howto:Use Terragear on Windows: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(→‎Elevation: corrected working directories for compatablility with genapts)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{merge|Using the Custom Scenery TerraGear Toolset}}
#REDIRECT[[Using TerraGear]]
{{merge|Using Terragear}}
 
'''This article is under development, please wait a few days so I can finish this article.'''
 
This [[:Category:Howto|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==
# Download the latest <tt>TerraGear-cs-Win32-....zip</tt> file from ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/.
# Create or choose a base directory, which you will subsequently use to work with the terragear tools.
# Unzip the package into a sub-directory named <tt>Terragear/</tt> in the base directory.
 
[[Image:Terragearprocesschart.png|thumb|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 <tt>data\SRTM-30</tt> in your base directory. (The reason why the directories are called SRTM-30 is because genapts will look for a few known, hardcoded directories in it's working directory. SRTM-30 is one of them and is the least confusing in that list.)
 
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. After that, open the commandline (Run > cmd.exe) and change into the base directory. Then type this: ('''NOTE:''' If you want to create a batch-file, repace <tt>%f</tt> with <tt>%%f</tt>, see [http://technet.microsoft.com/en-us/library/bb490909.aspx]) ('''NOTE:''' For SRTM-1 data, repalce the <tt>3</tt> by a <tt>1</tt> in the first argument to hgtchop)
 
for %f in (.\data\SRTM-30\*.hgt) do .\Terragear\hgtchop.exe 3 %f .\work\SRTM-30
 
Now you will get a lot of .arr.gz files in your work\SRTM-30\ 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!):
 
.\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==
* [[Using the Custom Scenery TerraGear Toolset]]
 
[[Category:Howto|Use Terragear on Windows]]
[[Category:Scenery enhancement|Use Terragear on Windows]]

Latest revision as of 16:55, 6 May 2012

Redirect to: