mNo edit summary
(Update latest release version number)
 
(50 intermediate revisions by 13 users not shown)
Line 1: Line 1:
{{Infobox Software
{{Infobox Software
| title                = TerraGear GUI
| title                = TerraGear GUI
| image                = TerraGearGUI.jpg
| image                = TerraGear GUI download San Francisco.png
| alt                  = The download page with the San Francisco bay area selected.
| developedby          = Gijs de Rooy (original by Alex Park)
| developedby          = Gijs de Rooy (original by Alex Park)
| initialrelease        = March 24, 2009 (original)
| initialrelease        = March 24, 2009 (original)<br>March 27, 2010
| writtenin            = C++ (Qt)
| latestrelease = 0.9.20 (2015)
| os                    = Windows (Linux, Mac OS X)
| writtenin            = C++
| website = http://gitorious.org/terragear/terrageargui/
| writteninlibs        = Qt
| os                    = Windows, Linux, Mac OS X
| website = https://sourceforge.net/p/flightgear/fgscenery/terrageargui/ci/master/tree/
}}
}}
The '''GUI''' tool for '''[[TerraGear]]''' allows people to create [[scenery]] for [[FlightGear]] without using commandlines.
The '''GUI''' tool for '''[[TerraGear]]''' allows people to create [[scenery]] for [[FlightGear]] without using commandlines.
== Obtaining the GUI ==
You can either build the GUI [https://sourceforge.net/p/flightgear/fgscenery/terrageargui/ci/master/tree/ from source], or download a pre-compiled build:
* [http://liveries.flightgear.org/terrageargui/ Windows builds]
Please note that:
* you need to download/compile a recent version of [[TerraGear]] as well;
* for Windows users, you'll need to add three DLLs to you TerraGear GUI root directory:
** msvcp71.dll (see [[TerraGear_Installation_for_Windows]] to know how to get it)
** mscvr71.dll (see [[TerraGear_Installation_for_Windows]] to know how to get it)
** gdal12.dll (this can be retrieved from ftp://ftp.ihg.uni-duisburg.de/FlightGear/Win32/terragear-cs-Win32-20101002.zip )
==== For GNU/Linux users ====
# Grab the sources and store it where you want:<br/><pre>git clone git://git.code.sf.net/p/flightgear/fgscenery/terrageargui</pre>
# Then go in the source:<br/><pre>cd terrageargui</pre>
# Create a build dir:<br/><pre>mkdir build && cd build</pre>
# Now build it:<br/><pre>qmake .. </pre> or<pre>qmake-qt4 ..</pre> then<pre>make</pre>
:::<sub>In case of ERRORS You may have to add the following via SYNAPTIC:</sub>
:::*<sub>for "/usr/lib/i386-linux-gnu/qt4/bin/uic: Command not found" add: libqt4-dev-bin</sub>
:::*<sub>for "QtGui/QApplication: No such file or directory" add: qt4-dev-tools</sub>
<br />
# You can now start it with:<br/><pre>"./bin/TerraGUI" or "./build/TerraGUI"</pre>
You're done!


== Using the GUI ==
== Using the GUI ==
Line 14: Line 40:


=== Start ===
=== Start ===
# Set the TerraGear directory, in which you'll find ogr-decode, fgfs-construct etc. TerraGear must be downloaded/build seperatly from the GUI!
# Set the TerraGear directory, in which you'll find the subdirectories bin/ and share/. TerraGear must be downloaded/build seperatly from the GUI!
# Set the project's directory. In this directory, all project related stuff will be stored throughout the process. You best choose an empty directory specific to your project.
# Set the project's directory. In this directory, all project related stuff will be stored throughout the process. You best choose an empty directory specific to your project.
# Set your FlightGear's root ([[$FG_ROOT]]). This is used to retrieve the list of available terrain materials.
=== Download ===
Specify boundaries in the boxes on the left, or select an area on the map. Next select a source to download shapefiles for that area. Note that OpenStreetMap only includes line date (roads, rivers), so you'll need some polygon data for the actual terrain. Both [[World Custom Scenery Project|Custom Scenery]] and [[CORINE]] (only Europe) provide that. The GUI downloads and unpacks the package to your <tt>{project's directory}/data/</tt>.
Alternatively you can download shapefiles from [http://mapserver.flightgear.org/download.psp the mapserver by hand]. Unpack the downloaded file(s) to your <tt>{project's directory}/data/</tt>.
==== Elevation data ====
Elevation files are optional, but of course required to generate scenery with elevation offsets (even flat countries like the Netherlands need elevation data, since no country is completely at sealevel. Simply select a data source and then click the button to download the HGT files that span your specified area. The original source is usgs.gov, but a cleaned variant of the same data is available from fgx.ch (see [http://downloads.fgx.ch/geodata/data/srtm/README.txt the readme] for more information). The data will be saved in in <tt>{project's directory}/data/SRTM-3</tt>.
===== By hand =====
[[File:HGT tiles example.png|thumb|An example of HGT file tiles.]]
Downloading tiles by hand is somewhat tricky. If your scenery has a boundary of:
{| class="wikitable"
!
! Min
! max
|-
! Latitude
| 33
| 37
|-
! Longitude
| -2
| 2
|}
The GUI would display the range as <tt>N33W002-N37E002</tt>. This means you have to download all tiles in that range, which are all the tiles as shown in the image on the right. Unpack the downloaded elevation file(s) in <tt>{project's directory}/data/SRTM-3</tt>.


=== HGT chop ===
If you don't know how to find the boundaries range you can use Google Earth with this KMZ file : [http://clemaez.fr/flightgear/grid_1_degree.kmz grid_1_degree.kmz]
This will convert the .hgt.zip files you have downloaded earlier on and converts them into a form that TerraGear can read.
# Download KMZ file above
# Open it with Google Earth and active it (if not yet active). A lot of red lines should appears
# Zoom where you want know the boundaries range
# Click on the bottom left boundary wanted and report the displayed value in TerraGear GUI. (i.e: if Google Earth value is "W9_N42", report Minimum Latitude value "42" and Minimum Longitude value "-9")
# Click on the top right boundary wanted and report the displayed value in TerraGear GUI. (i.e: if Google Earth value is "E6_N45", report Maximum Latitude value "45" and Maximum Longitude value "6")


=== Genapts ===
=== Elevation ===
What is scenery without airport in a flight simulator? If your tile does not contain any airports, you can skip this part and continue with [[#ogr-decode|ogr-decode]].
This will convert the .hgt.zip files (that you have downloaded earlier) into a form that TerraGear can read. Simply select the directory in which you placed the elevation downloads (probably <tt>{project's directory}/data/SRTM-3</tt>). Make sure you do set the correct resolution! For the USA this can be 1 arcsec, while the rest of the world is provided in 3 arcsec resolution.


First create the <tt>data/Airports/</tt> directory. Then locate FlightGears <tt>apt.dat.gz</tt> file, which is usually in <tt>[[$FG ROOT]]/Airports/</tt> in the just created directory. Unpack the file before you continue.
=== Airports ===
What is scenery without airports in a flight simulator? If your area does not contain any airports, you can skip this part and continue with [[#ogr-decode|ogr-decode]].


Use the button to browse to the (unpacked) .dat file. If you only want to create the scenery for a specific airport you can enter the ICAO name into the relevant field. If you do not enter any information in any of the boxes, the tool will run through the entire apt.dat file, which can take a long time.
You can do two things now:
*'''Already-made airports:''' use FlightGear's <tt>apt.dat.gz</tt> file, which is usually in <tt>[[$FG ROOT]]/Airports/</tt>.
*'''Home-made airports:''' if you created an airport in [[WorldEditor]], use the .dat file that you exported.


=== OGR Decode ===
Use the button to browse to the .dat file of your choice.
Now we need to decode the shapefiles into TerraGear format, which we do with OGR Decode. After clicking the "Retrieve shapefiles" button, the left list will be populated with the shapefiles from your project's data directory. On the right list you'll add the materials, per shapefile. Each single shapefile on the left, should have a material assigned on the right. By dragging materials up&down, you can finetune the material assignments.


'''Warning: *_landmass MUST be mapped onto the material Default.'''  
* '''All airports in area''' generates all the airports within the boundaries as set on the start tab.
* '''Single airport''' to generate the scenery for a specific airport. Enter the ICAO code into the field.
* '''Single tile''' only processes airports that are located on the given tileid.
* '''All airports in apt.dat''' the tool will run through the entire apt.dat file, which can take a long (!) time when using the default apt.dat from FlightGear.


You can delete shapefiles and materials from the lists by double-clicking on them.
=== Materials ===
Now we need to decode the shapefiles into TerraGear format, which we do with OGR Decode. After clicking the "Retrieve shapefiles" button, the list will be populated with the shapefiles from your project's data directory. The GUI will try to assign fitting materials. If a shapefile has no material, you'll need to assign it by hand. Each single shapefile must have a material.


=== FGFS Construct ===
You can delete shapefiles from the list by double-clicking on them. A single click on a material will allow you to edit it; to create custom materials that are not (yet) in materials.xml (do note that FlightGear will apply the default material to those landclasses, untill you create the material in materials.xml!).  
The fgfs-construct tool brings all your gathered data together, throws it in a washing machine and spits it out the otherside in format ready for use with FlightGear. Click the "Update list" button to populate the field with all decodes shapefiles. In the list you select all types that you'd like to include in your scenery.


Then set the center of the to-be-created scenery area; and the radius, all in degrees.
Line width is only used on line-data (like roads, rivers and railroads). If you leave the line width fields empty, a default width of 10 meters is used.
 
===== Example =====
 
{| class="wikitable"
|-
! Shapefile !! Material !! Line width (in meters)
|-
| osm_canal || Canal || 12
|-
| osm_motorway || Road-Motorway || 12
|-
| osm_primary || Road-Primary || 10
|-
| osm_rail || Railroad || 5
|-
| osm_river || Canal || 8
|-
| osm_secondary || Road-Secondary || 8
|-
| osm_stream || Stream || 3
|-
| osm_tertiary || Road-Tertiary || 6
|-
| osm_trunk || Road-Trunk || 18
|}
 
=== Construct ===
[[Image:TerraGearGUI.png|thumb|The construction page.|alt=]]
'''Note: with recent TerraGear builds, it is required to add the used material-names to the default_priorities.txt file.'''
 
The tg-construct tool brings all your gathered data together, throws it in a washing machine and spits it out the otherside in a format ready for use with FlightGear. Click the "Update list" button to populate the field with all decoded shapefiles. In the list you select all types that you'd like to include in your scenery.


After clicking the "Generate scenery" button, it may take a long time for TerraGear to finish. Depending on the size of the area you are creating the scenery for and the level of detail in your shapefiles. Simple and small sceneries will take a couple of minutes, where larger, more detailed areas can take over an hour! So trying new things on small areas first will save you a lot of time.
After clicking the "Generate scenery" button, it may take a long time for TerraGear to finish. Depending on the size of the area you are creating the scenery for and the level of detail in your shapefiles. Simple and small sceneries will take a couple of minutes, where larger, more detailed areas can take over an hour! So trying new things on small areas first will save you a lot of time.


The folders and files in your project's <tt>output/</tt> directory are ready to use as scenery. You can set the scenery path of FlightGear to this directory to check if the scenery is generated correctly.
=== Running the scenery ===
The folders and files in your project's <tt>output/</tt> directory are ready to use as scenery. You can set the [[$FG_SCENERY|scenery path]] of FlightGear to this directory to check if the scenery is generated correctly.  


== GUI development ==
== GUI development ==
The GUI is currently undergoing a complete rebuild and re-written in [http://qt.nokia.com Qt]. This will allow us to build the GUI on multiple OSes (Mac OS X, UNIX, Windows).
The current source code can be retrieved [https://sourceforge.net/p/flightgear/fgscenery/terrageargui/ci/master/tree/ from SourceForge].


The current source code can be retrieved [http://gitorious.org/terragear/terrageargui/ from Gitorious].
Feel free to add feature requests and/or bug reports to this page. Anyone interested in helping is invited to contact Gijs at the forum.


Feel free to add feature requests and/or bug reports.
=== Requested features ===
Also see [[TerraGear scenery build server]]


=== Requested features ===
[[File:TerraGear-GUI-Remote-Mode.png|thumb|Prototyping a remote mode for [[TerraGear]] as part of [[TerraGear GUI]]|alt=]]
* Creating automatically all needed folders for shapefiles and the decoded ones. This includeds automated decoding all shapefiles in a directory.
 
* Maybe error reports possible? So you get a message when a certain file isn't found, or a certain path isn't set. Right now it only appears in the console, but it's hard to read the fast scrolling text.
* Multi-threading, so the GUI doesn't freeze when running a process [http://forum.flightgear.org/viewtopic.php?f=5&t=25688&p=235873&hilit=#p235623]
* Support a new "Setup" page where people can decide if TerraGear is installed locally or remotely {{Not done}}
* Add a command handler abstraction so that commands  can be easily run over SSH [http://doc.qt.digia.com/qtcreator-extending/utils-sshconnection.html] {{Not done}}
* File retrieval would ideally be wrapped via SFTP {{Not done}}
 
== External link ==
* [http://forum.flightgear.org/viewtopic.php?f=5&t=7485 Forum topic]


[[Category:Scenery enhancement]]
[[Category:Scenery enhancement]]
[[Category:TerraGear]]

Latest revision as of 11:04, 20 December 2021

The GUI tool for TerraGear allows people to create scenery for FlightGear without using commandlines.

TerraGear GUI
The download page with the San Francisco bay area selected.
The download page with the San Francisco bay area selected.
Developed by Gijs de Rooy (original by Alex Park)
Initial release March 24, 2009 (original)
March 27, 2010
Latest release 0.9.20 (2015)
Written in C++ (Qt)
OS Windows, Linux, Mac OS X
Website

Obtaining the GUI

You can either build the GUI from source, or download a pre-compiled build:

Please note that:

For GNU/Linux users

  1. Grab the sources and store it where you want:
    git clone git://git.code.sf.net/p/flightgear/fgscenery/terrageargui
  2. Then go in the source:
    cd terrageargui
  3. Create a build dir:
    mkdir build && cd build
  4. Now build it:
    qmake .. 
    or
    qmake-qt4 ..
    then
    make
In case of ERRORS You may have to add the following via SYNAPTIC:
  • for "/usr/lib/i386-linux-gnu/qt4/bin/uic: Command not found" add: libqt4-dev-bin
  • for "QtGui/QApplication: No such file or directory" add: qt4-dev-tools


  1. You can now start it with:
    "./bin/TerraGUI" or "./build/TerraGUI"

You're done!

Using the GUI

The GUI exist of several tabs. For normal scenery creation, all the tabs should be gone through in the order they are arranged.

Start

  1. Set the TerraGear directory, in which you'll find the subdirectories bin/ and share/. TerraGear must be downloaded/build seperatly from the GUI!
  2. Set the project's directory. In this directory, all project related stuff will be stored throughout the process. You best choose an empty directory specific to your project.
  3. Set your FlightGear's root ($FG_ROOT). This is used to retrieve the list of available terrain materials.

Download

Specify boundaries in the boxes on the left, or select an area on the map. Next select a source to download shapefiles for that area. Note that OpenStreetMap only includes line date (roads, rivers), so you'll need some polygon data for the actual terrain. Both Custom Scenery and CORINE (only Europe) provide that. The GUI downloads and unpacks the package to your {project's directory}/data/.

Alternatively you can download shapefiles from the mapserver by hand. Unpack the downloaded file(s) to your {project's directory}/data/.

Elevation data

Elevation files are optional, but of course required to generate scenery with elevation offsets (even flat countries like the Netherlands need elevation data, since no country is completely at sealevel. Simply select a data source and then click the button to download the HGT files that span your specified area. The original source is usgs.gov, but a cleaned variant of the same data is available from fgx.ch (see the readme for more information). The data will be saved in in {project's directory}/data/SRTM-3.

By hand
 
An example of HGT file tiles.

Downloading tiles by hand is somewhat tricky. If your scenery has a boundary of:

Min max
Latitude 33 37
Longitude -2 2

The GUI would display the range as N33W002-N37E002. This means you have to download all tiles in that range, which are all the tiles as shown in the image on the right. Unpack the downloaded elevation file(s) in {project's directory}/data/SRTM-3.

If you don't know how to find the boundaries range you can use Google Earth with this KMZ file : grid_1_degree.kmz

  1. Download KMZ file above
  2. Open it with Google Earth and active it (if not yet active). A lot of red lines should appears
  3. Zoom where you want know the boundaries range
  4. Click on the bottom left boundary wanted and report the displayed value in TerraGear GUI. (i.e: if Google Earth value is "W9_N42", report Minimum Latitude value "42" and Minimum Longitude value "-9")
  5. Click on the top right boundary wanted and report the displayed value in TerraGear GUI. (i.e: if Google Earth value is "E6_N45", report Maximum Latitude value "45" and Maximum Longitude value "6")

Elevation

This will convert the .hgt.zip files (that you have downloaded earlier) into a form that TerraGear can read. Simply select the directory in which you placed the elevation downloads (probably {project's directory}/data/SRTM-3). Make sure you do set the correct resolution! For the USA this can be 1 arcsec, while the rest of the world is provided in 3 arcsec resolution.

Airports

What is scenery without airports in a flight simulator? If your area does not contain any airports, you can skip this part and continue with ogr-decode.

You can do two things now:

  • Already-made airports: use FlightGear's apt.dat.gz file, which is usually in $FG ROOT/Airports/.
  • Home-made airports: if you created an airport in WorldEditor, use the .dat file that you exported.

Use the button to browse to the .dat file of your choice.

  • All airports in area generates all the airports within the boundaries as set on the start tab.
  • Single airport to generate the scenery for a specific airport. Enter the ICAO code into the field.
  • Single tile only processes airports that are located on the given tileid.
  • All airports in apt.dat the tool will run through the entire apt.dat file, which can take a long (!) time when using the default apt.dat from FlightGear.

Materials

Now we need to decode the shapefiles into TerraGear format, which we do with OGR Decode. After clicking the "Retrieve shapefiles" button, the list will be populated with the shapefiles from your project's data directory. The GUI will try to assign fitting materials. If a shapefile has no material, you'll need to assign it by hand. Each single shapefile must have a material.

You can delete shapefiles from the list by double-clicking on them. A single click on a material will allow you to edit it; to create custom materials that are not (yet) in materials.xml (do note that FlightGear will apply the default material to those landclasses, untill you create the material in materials.xml!).

Line width is only used on line-data (like roads, rivers and railroads). If you leave the line width fields empty, a default width of 10 meters is used.

Example
Shapefile Material Line width (in meters)
osm_canal Canal 12
osm_motorway Road-Motorway 12
osm_primary Road-Primary 10
osm_rail Railroad 5
osm_river Canal 8
osm_secondary Road-Secondary 8
osm_stream Stream 3
osm_tertiary Road-Tertiary 6
osm_trunk Road-Trunk 18

Construct

 
The construction page.

Note: with recent TerraGear builds, it is required to add the used material-names to the default_priorities.txt file.

The tg-construct tool brings all your gathered data together, throws it in a washing machine and spits it out the otherside in a format ready for use with FlightGear. Click the "Update list" button to populate the field with all decoded shapefiles. In the list you select all types that you'd like to include in your scenery.

After clicking the "Generate scenery" button, it may take a long time for TerraGear to finish. Depending on the size of the area you are creating the scenery for and the level of detail in your shapefiles. Simple and small sceneries will take a couple of minutes, where larger, more detailed areas can take over an hour! So trying new things on small areas first will save you a lot of time.

Running the scenery

The folders and files in your project's output/ directory are ready to use as scenery. You can set the scenery path of FlightGear to this directory to check if the scenery is generated correctly.

GUI development

The current source code can be retrieved from SourceForge.

Feel free to add feature requests and/or bug reports to this page. Anyone interested in helping is invited to contact Gijs at the forum.

Requested features

Also see TerraGear scenery build server

 
Prototyping a remote mode for TerraGear as part of TerraGear GUI
  • Multi-threading, so the GUI doesn't freeze when running a process [1]
  • Support a new "Setup" page where people can decide if TerraGear is installed locally or remotely   Not done
  • Add a command handler abstraction so that commands can be easily run over SSH [2]   Not done
  • File retrieval would ideally be wrapped via SFTP   Not done

External link