Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G


Jump to: navigation, search

Howto:Create custom terrain

45 bytes removed, 7 June
Switch to the {{forum link}} template for all forum links.
'''Custom terrain ''' in [[FlightGear ]] is currently generated through processing shapefiles with [[TerraGear]]. In order to add custom scenery to FlightGear, you must create a custom shapefile.
A "shapefile" is a proprietary spatial information format. You can edit them with almost every GIS package. QGIS is quite a good package for this type of project.
Your goal for editing area data is to create a shapefile of a seamless layer of polygons which correspond to some type of land cover. This data is then fed into [http://mapserver.flightgear.org the mapserver ] and, possibly, TerraGear to create new scenery.
=== Evaluating the current data ===
Before you begin, please make sure the area you want to improve doesn't already have good coverage. Just because it looks bad in FlightGear does not mean the area has not been improved. For this, you will need to check the Flightgear Mapserver, at [http://mapserver.flightgear.org/ mapserver.flightgear.org].
Let's take a look at the Finistère in Brittany, Western France: if you click [http://mapserver.flightgear.org/map/?lon=-4.41840585539649&lat=48.4484146908477&zoom=11&layers=0B000000FTTFFFFFTFT here], you will quickly see and understand how FlightGear interprets the data pertaining to Finistère county is known of [[FlightGear]]. Some towns/cities (red), a few forests (green), etc. Overall, it is not a very good resolution: a lot of angles, the detail level is not that good, some towns are missing. If you want a better definition on ground, there is some work to be done! The goal being to obtain something like this:
# [http://mapserver.flightgear.org/map/?lon=13.40385&lat=52.50199&zoom=11&layers=000000BFFFFFFFFFTFFF B0000000TFFFTFFFTFFFFFFF Berlin]# [http://mapserver.flightgear.org/map/?lon=9.40368&lat=47.63699&zoom=11&layers=B000000FFFFFFFFFTFFF B0000000TFFFTFFFTFFFFFFF Bodensee surroundings]# [http://mapserver.flightgear.org/map/?lon=-88.55704&lat=43.98436&zoom=11&layers=000000BFFFFFFFFFTFFF B0000000TFFFTFFFTFFFFFFF Oshkosh surroundings]# [http://mapserver.flightgear.org/map/?lon=-62.87648&lat=17.69865&zoom=10&layers=B000000FFFFFFFFFTFFF CarribsB0000000TFFFTFFFTFFFFFFF Carribean Islands]
You will immediately notice the improvement to the ground. When flying, the difference is huge. Moreover, this enables the autogeneration of cities, trees, farmland, and so on.
[[File:C31e36f2a2cbb278a1603dfe2ba91193.media.395x288.png|thumb|200px|Landsat Map Search]]
[[File:1c9334d970963364b5ce1bc3a166a4fa.media.426x192.png|thumb|200px|Preview and download Landsat image]]
Browse to [http://glcfapp.umiacsglcf.umd.edu:8080/esdi/index.jsp the Earth Science Data Interface interface] ([http://glcfapp.glcf.umd.edu:8080/esdi/index.jsp mirror]) to grab your [http://en.wikipedia.org/wiki/Landsat Landsat] data.
# Click ''Map Search''.
* QGIS Download for Linux/OSX/Windows [http://www.qgis.org/en/download/current-software.html]
The following is largely adapted from the [http://stattosoftware.com/flightgear/tutorial/index.html original QGIS scenery tutorial], which you may find of use.
# Modify the filter to search for *.tif files.
# Add the TIFF file you have just downloaded.
# Rightclick on the image in the layer sidebar and choose <tt>Set layer CRS</tt>, to select a projection model. This depends on the location of the area you're about to create. Look up your project's UTM coordinate through [http://upload.wikimedia.org/wikipedia/commons/e/ed/Utm-zones.jpg this image]. For Texel this is 31U, north of the equator, so we choose <tt>Projected Coordinate Systems > Universal Transverse Mercator (UTM) > WSG84 / UTM zone 31N</tt>. Locations south of the equator may need to use the 'N' zones as well. For example, the correct projection for Perth, Australia is <tt>Projected Coordinate Systems > Universal Transverse Mercator (UTM) > WSG84 / UTM zone 50N</tt>. Always select 'WGS84', as that is the globe model used in FlightGear. # Click on <tt>Layer > Add a new vector layerNew > New Shapefile Layer</tt> or on the corresponding icon. A dialog should pop up.#* Make sure the file type is an ESRI Shapefile. #* Make sure the vector type is set to polygon. #* # Click the 'specify CRS' button, to select a projection model. This must be the same as we did for the tiff background image.## You need to create a data column for this layer. Create a column new attribute called 'class'. Make sure it is a 'text data' (string ) column. Add it to the attribute list by selecting the Add Values Manually button. ## The 'OK' button should now be available for you to select. Select 'OK'. #* # There should be a dialog box prompting you to save your vector layer. Save it in your scenery directory with your GeoTIFF. (This is not required but significantly helps organization.) #* A projection box should pop up. Select 'WGS 1984'. After all, that is the globe model used in FlightGear.
# Your vector layer should appear in the left-hand toolbar. You are ready to begin digitizing.
# Select the newly created layer in the layer list, toggle editing (<tt>Layer > Toggle Editing</tt>) and finally select Capture Polygon from the same menu/toolbar.
Continue with tracing all shapes on the island: towns, industrial areas, grass, farmland etc.
It is imporant to enable "snaping" now. We don't want small holes in our scenery, nor do we want overlapping polygons. Snapping adjusts each point as you go by - you will miss occasionally and have to correct it - so you don't have to worry about lining the polygons up precisely.
===Snapping===It is very important to enable "snapping" now. Snapping means each polygon will fit together nicely, like a jigsaw puzzle. If snapping is not enabled, the polygons will not form a continuous layer, which has a number of different problems. We don't want small holes in our scenery, nor do we want overlapping polygons. Snapping adjusts each point as you go by - you will miss occasionally and have to correct it - so you don't have to worry about lining the polygons up precisely. # Open <tt>Settings > Project PropertiesSnapping Options</tt> and click the Snapping options... button.# Click the tickbox(es) in front of your layer(s) and set Tolerance to 20 (map units). A smaller tolerance will make it easier to work with very small and detailed layers, while a bigger value makes it easier to snap when zoomed out.
# Click OK to save the snapping options.
In order to turn the landclass into scenery we have to split it into seperate shapefiles for each landclass.
# Open the Attribute table (<tt>Layer > Open Attribute tableTable</tt>).
# Type "Sand" (or another class) into the search box and press the Search button. This will select all polygons that have the Sand class assigned.
# Go to <tt>Layer > Save Selection as Shapefilevector file</tt> and save the sand shapefile somewhere on your computer.
# Do the same for all other classes.
# To make the difference between land and sea (landmass) we save the entiry shapefile (<tt>Layer > Save as Shapefile</tt>)We have been working with UTM coordinates so far. To generate scenery that can be used in FlightGear we need to convert the shapefiles to the latitude/longitude format* '''Windows'''*# Download [http://www.forestpal.com/fgis.html fGIS] and install it as described.*# Open an empty project and visit <tt>Utilities > Shapefile Projection Utility</tt>.*# Look up your projects UTM coordinate through [http://upload.wikimedia.org/wikipedia/commons/e/ed/Utm-zones.jpg this image]. For Texel this is 31U, so we choose UTM31 in fGIS. If your project is located south of the equator, you tick the S box.*# Set the Output ESRI Shapefile Project to <tt>Lat./Lon.</tt>.*# Now click the Input Shapefile button to load the shapefile that we exported from QGIS.*# Using the Output Shapefile button we decide where we want to store the lat/lon shapefile. This has to be a non-exisiting file, so remove before updating.*# Click the Convert button.*# Repeat this process for all shapefiles).
If you want to see these shapefiles integrated into the Custom Scenery database you can contact papillon81 and statto (through IRC or Forum). Please be remembered that your data has to be derived from freely available (public domain) sources. Other material can not be integrated due to legal issues.
== External links ==
{{forum|5|scenery enhancement}}
* [http://www.custom-scenery.org Terragear-cs website]
* [http://wiki.qgis.org QGIS Wiki]
* [http://www.flightgear.org/forums/viewforum.php?f=5 Dedicated FlightGear forums for scenery enhancement]
* [http://wiki.osgeo.org/wiki/LandcoverDB_CS_Detail OSGEO Wiki]
* {{forum link|t=5566|text=Editing shapefiles for inclussion in official scenery}} (forum topic)
=== Resources ===
* [http://stattosoftware.com/flightgear/tutorial/index.html Tutorial by John Holden]
[[fr:Howto: Utilisé QGIS et images satellites]]
[[Category:Howto|Using QGIS and satellite pictures]][[Category:Scenery enhancement|Using ]] [[fr:Howto: Utiliser QGIS and satellite pictureset images satellites]]

Navigation menu