Using TerraGear: Difference between revisions

Jump to navigation Jump to search
m
Robot: Cosmetic changes
m (Robot: Cosmetic changes)
Line 1: Line 1:
[[Image:Terragearprocesschart.png|thumb|TerraGear Process Flow Chart]]
[[File:Terragearprocesschart.png|thumb|TerraGear Process Flow Chart]]
The [[TerraGear]] software project supports [[FlightGear]] by creating the files used by FlightGear to represent the elevation and texture of the earth, including airports, cities, fields, forests, rivers, roads and so on. The TerraGear software reads data files containing ground elevation, airport locations and layouts, geographical land-cover data, and more, and produces the scenery files used by FlightGear to represent the terrain of the world.
The [[TerraGear]] software project supports [[FlightGear]] by creating the files used by FlightGear to represent the elevation and texture of the earth, including airports, cities, fields, forests, rivers, roads and so on. The TerraGear software reads data files containing ground elevation, airport locations and layouts, geographical land-cover data, and more, and produces the scenery files used by FlightGear to represent the terrain of the world.


Line 6: Line 6:
For instance, if you use [[TaxiDraw]] to modify/improve information about an [[:Category:Airports|airport]]'s taxiway/apron layout, you might wish to see how that modified airport would look in the scenery before deciding you're happy with the results. Maybe the official scenery is too detailed for your slow machine, and you'd like to build terrain using a digital elevation model (DEM) with poorer resolution, to decrease the number of polygons and thus improve your framerates. Or maybe you've got a fantastically fast machine, and you want to build your own terrain using higher-resultion vector data (vmap1, Tiger, osm) to get better roads/streams. For all these reasons, learning how to use TerraGear is a good idea.
For instance, if you use [[TaxiDraw]] to modify/improve information about an [[:Category:Airports|airport]]'s taxiway/apron layout, you might wish to see how that modified airport would look in the scenery before deciding you're happy with the results. Maybe the official scenery is too detailed for your slow machine, and you'd like to build terrain using a digital elevation model (DEM) with poorer resolution, to decrease the number of polygons and thus improve your framerates. Or maybe you've got a fantastically fast machine, and you want to build your own terrain using higher-resultion vector data (vmap1, Tiger, osm) to get better roads/streams. For all these reasons, learning how to use TerraGear is a good idea.


==Obtaining TerraGear==
== Obtaining TerraGear ==
You can either build TerraGear yourself, or download a pre-compiled binary. The later is the easiest and advised for starters.
You can either build TerraGear yourself, or download a pre-compiled binary. The later is the easiest and advised for starters.


Line 19: Line 19:
''Note:'' You might need default_priorities.txt from the mapserver [http://mapserver.flightgear.org/git/?p=terragear-cs;a=blob_plain;f=src/BuildTiles/Clipper/default_priorities.txt;h=4bb644a265ffc978a4303aad79169ace7ec1f043;hb=61ac48f3e56941b82aeb35960252c6ec4b7388d4 Git respository] See this forum thread for details: [http://www.flightgear.org/forums/viewtopic.php?f=5&p=77950]
''Note:'' You might need default_priorities.txt from the mapserver [http://mapserver.flightgear.org/git/?p=terragear-cs;a=blob_plain;f=src/BuildTiles/Clipper/default_priorities.txt;h=4bb644a265ffc978a4303aad79169ace7ec1f043;hb=61ac48f3e56941b82aeb35960252c6ec4b7388d4 Git respository] See this forum thread for details: [http://www.flightgear.org/forums/viewtopic.php?f=5&p=77950]


==Using TerraGear==
== Using TerraGear ==
First, choose the boundaries for the area of scenery you want to build, in terms of latitude and longitude. The smaller the area of scenery you generate, the smaller the amount of data you will need, and the less CPU time it will take. For example, if you are just interested in generating a new airport layout at 12.3W 34.4N, then simply generating the scenery between 12W 34N and 13W 35N would be sufficient.  
First, choose the boundaries for the area of scenery you want to build, in terms of latitude and longitude. The smaller the area of scenery you generate, the smaller the amount of data you will need, and the less CPU time it will take. For example, if you are just interested in generating a new airport layout at 12.3W 34.4N, then simply generating the scenery between 12W 34N and 13W 35N would be sufficient.  


Line 30: Line 30:
* '''work/''' - for data that has been processed (eg by shape-decode) and is ready to be munged into scenery  
* '''work/''' - for data that has been processed (eg by shape-decode) and is ready to be munged into scenery  


===Obtaining and processing data===
=== Obtaining and processing data ===
Terragear uses three different kinds of information to generate scenery:
Terragear uses three different kinds of information to generate scenery:


Line 41: Line 41:
'''<u>Please note:</u> for inclusion in the official FlightGear scenery, all data <u>must</u> come from [[GNU GPL]] compatible sources!'''
'''<u>Please note:</u> for inclusion in the official FlightGear scenery, all data <u>must</u> come from [[GNU GPL]] compatible sources!'''


====Elevation data====
==== Elevation data ====
The best elevation data currently available is from the Shuttle Radar Topography Mission (SRTM). There are two types of SRTM data:  
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  
* Highly accurate 1-arcsecond resolution data, known as SRTM-1, for the USA  
Line 68: Line 68:
  ./Terragear/terrafit work/SRTM-3
  ./Terragear/terrafit work/SRTM-3


====Airport data====
==== Airport data ====
Now we've got elevation data, we can generate our airports. First, create a <tt>data/airports/</tt> directory and copy in your apt.dat file. This may be direct from your FlightGear data package (though you'll need to unzip it), or it may be one that you've modified with [[TaxiDraw]].  
Now we've got elevation data, we can generate our airports. First, create a <tt>data/airports/</tt> directory and copy in your apt.dat file. This may be direct from your FlightGear data package (though you'll need to unzip it), or it may be one that you've modified with [[TaxiDraw]].  


Line 87: Line 87:
These contain the definitions of the airport layout and any objects present (e.g. windsocks).  
These contain the definitions of the airport layout and any objects present (e.g. windsocks).  


====Landuse data====
==== Landuse data ====
The final piece of data we need to generate is the landuse data. In general, this is taken from the VMAP0 dataset as shapefiles from the scenery database mapserver, but other sources can also be used.
The final piece of data we need to generate is the landuse data. In general, this is taken from the VMAP0 dataset as shapefiles from the scenery database mapserver, but other sources can also be used.


Line 110: Line 110:
* the material type
* the material type


Each shape-file corresponds with one of the material types defined in the materials.xml files. The mapping is pretty obvious. For example, v0_mixedcroppasturecover maps to MixedCropPastureCover. Note that the material types are case-sensitive, so it is a good idea to refer to the <tt>[[$FG_ROOT]]/materials.xml</tt> file to hand so you can check. The exception is v0_landmass, which MUST be mapped onto the type Default.
Each shape-file corresponds with one of the material types defined in the materials.xml files. The mapping is pretty obvious. For example, v0_mixedcroppasturecover maps to MixedCropPastureCover. Note that the material types are case-sensitive, so it is a good idea to refer to the <tt>[[$FG ROOT]]/materials.xml</tt> 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.
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.
Line 128: Line 128:
Run this command for each shapefile in the set.
Run this command for each shapefile in the set.


==Generating scenery==
== Generating scenery ==
You will now have a work directory looking something like this:
You will now have a work directory looking something like this:


Line 156: Line 156:
When this finishes, the output directory will contain a scenery sub-tree.
When this finishes, the output directory will contain a scenery sub-tree.


Point to it by setting either [[$FG_SCENERY]] or by using the --fg-scenery command-line option to fgfs, and give your new scenery a try!
Point to it by setting either [[$FG SCENERY]] or by using the --fg-scenery command-line option to fgfs, and give your new scenery a try!


==Troubleshooting==
== Troubleshooting ==
Below is a list of common problems and solutions. If in doubt - Google it. Many problems (particularly when compiling TerraGear) have been hit before:  
Below is a list of common problems and solutions. If in doubt - Google it. Many problems (particularly when compiling TerraGear) have been hit before:  


Navigation menu