Using TerraGear: Difference between revisions

Jump to navigation Jump to search
Line 87: Line 87:
* '''Point data:''' is currently only used for defining towns.
* '''Point data:''' is currently only used for defining towns.
   
   
By far the easiest way to get this data is to download shape-files from the wonderful [http://mapserver.flightgear.org MapServer]. This provides access to a database of information, and allows you to download the specifi shapefiles for your scenery area. Click on the Download Shapefiles link (or go direct: http://mapserver.flightgear.org/download.psp). Enter in the bounding box of the scenery you want to generate, select the shapefiles you want, and click download. For your first scenery generation, you want all of the ones listed under VMap0 (with prefix v0_).  
By far the easiest way to get this data is to download shape-files from the wonderful [http://mapserver.flightgear.org MapServer]. The MapServer lets you download the shape-files for any selected scenery area. Click on the Download Shapefiles link (or go direct: http://mapserver.flightgear.org/download.psp). Enter in the bounding box of the scenery you want to generate, select the type of shapefile data you want, and click download. For basic scenery, get everything listed under VMap0 (with prefix v0_).  
   
   
Download each of them into a <tt>data/shapefiles/</tt> directory.
Download each shape-file into a <tt>data/shapefiles/</tt> directory.


You can load these shapefiles into a GIS editor such as [[QGIS]] or GRASS to view and edit. This is a good idea to verify you have the correct files! Later on, you can experiment with replacing various shapefiles with other versions (GSHHS for coastline, OSM for roads etc.).
You can load these shapefiles into a GIS editor such as [[QGIS]] or GRASS to view and edit. This is a good idea to verify you have the correct files! Later on, you can experiment with replacing various shapefiles with other versions (GSHHS for coastline, OSM for roads etc.).


You now need to decode these into TerraGear format. This is done with the shape-decode command.  
The next step is to decode the shape-files into TerraGear format using the '''shape-decode''' command.  


There are three important command-line arguments to shape-decode:
There are three important command-line arguments for shape-decode:
* the filename of the shapefile (without the .shp extension) you want to decode
* the file-name of the shape-file (without the .shp extension)
* the directory you want to write the data to
* the destination directory for the decoded data
* the material type to use.
* the material type


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.
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 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.
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.
240

edits

Navigation menu