Using TerraGear: Difference between revisions

Jump to navigation Jump to search
m
(→‎Elevation data: Added back improved Linux scripting instructions. Please don't change everything to Win style)
m (→‎Landuse data: update)
Line 92: Line 92:
* '''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]. 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_).  
By far the easiest way to get this data is to download shapefiles from the wonderful [http://mapserver.flightgear.org MapServer]. The MapServer lets you download the shapefiles 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 shape-file into a <tt>data/shapefiles/</tt> directory.
Download each shapefile 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.).


The next step is to decode the shape-files into TerraGear format using the '''shape-decode''' command.  
The next step is to decode the shape-files into TerraGear format using the '''ogr-decode''' command.  


There are three important command-line arguments for shape-decode:
There are three important command-line arguments for ogr-decode:
* the file-name of the shape-file (without the .shp extension)
* the destination directory for the decoded data
* the destination directory for the decoded data
* the location of the shapefile's directory
* 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 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 <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 111: Line 111:
For example, to decode the v0_landmass shapefile, you use the following command:
For example, to decode the v0_landmass shapefile, you use the following command:


  shape-decode --max-segment 500 data/shapefiles/v0_landmass work/Landmass Default
ogr-decode --max-segment 500 --area-type Default work/Landmass data/shapefiles/v0_landmass


To create streams of width 10 metres
To create streams of width 10 metres


  shape-decode --max-segment 500 --line-width 10 data/shapefiles/v0_stream work/Stream Stream
ogr-decode --max-segment 500 --line-width 10 --area-type Stream work/Stream data/shapefiles/v0_stream


To generate some towns about 1km across
To generate some towns about 1km across


  shape-decode --point-width 500 data/shapefiles/v0_town work/Town Town
ogr-decode --point-width 500 --area-type Town work/Town data/shapefiles/v0_town


Run this command for each shapefile in the set.
Run this command for each shapefile in the set.

Navigation menu