Jon S Berndt wrote:

What are the steps involved? I can help out, I think.

Download one or more DEM files from here (this needs to be coordinated): http://edcsgs9.cr.usgs.gov/pub/data/srtm/SRTM30

Get TerraGear working:
http://www.terragear.org

And follow these steps (unless I'm mistaken):

3. Preparing the Datasets

After following the instructions in the previous section, you should have the following three data files downloaded onto your computer:

    * w100n90.tar.gz (approx. 15MB)
    * default.apt.gz (approx. 1MB)
    * v0noa.tar.gz (approx. 145MB)

Before you go any further, you need to create a root directory for scenery building. Personally, I use /usr/local/src/Scenery/, but you can set things up any way you like. Inside your root scenery directory, create two subdirectories, ./work/ and ./data/:

$ cd /usr/local/src/Scenery/
$ mkdir work
$ mkdir data

3.1. Preparing the Elevation Data

Change into the data directory, and create a dem30 subdirectory to hold the DEM data, then change to the dem30 subdirectory and unpack the :

$ cd data
$ mkdir dem30
$ cd dem30
$ tar xvzf ../../w100n90.tar.gz

You should end up something like this:

-rw-r--r--    1 david    david    57600000 Jan 21  1997 W100N90.DEM
-rw-r--r--    1 david    david         222 Jan 21  1997 W100N90.DMW
-rw-r--r--    1 david    david      114634 Jan 22  1997 W100N90.GIF
-rw-r--r--    1 david    david         327 Jan 23  1997 W100N90.HDR
-rw-r--r--    1 david    david         648 Jan 21  1997 W100N90.PRJ
-rw-r--r--    1 david    david         326 Jan 23  1997 W100N90.SCH
-rw-r--r--    1 david    david    28800000 Jan 21  1997 W100N90.SRC
-rw-r--r--    1 david    david          28 Jan 21  1997 W100N90.STX

First, we need to convert the DEM from the current binary format to an ASCII format that TerraGear can handle, using TerraGear's raw2ascii command (we'll put the output in an ascii subdirectory). You can skip this step if you're using the US 3arcsec DEMs, since they're already in ASCII format:

$ mkdir ascii
$ raw2ascii W100N90 ascii

Ouch! The command runs for a while and ends up creating 2,000 files in the ascii/ subdirectory, using up over 200MB of disk space; the good news is that you'll be able to delete these soon. In fact, you can already delete the original 57MB DEM files, since you won't be needing them anymore (you might want to back up the original tarball somewhere, though):

$ rm -v W100N90*

Now, if you know for certain (really for certain) that you're not going to build any scenery outside of the w080n40 chunk, you can also delete all of the extra DEM files that you won't be needing. For w080n40, you need w071n40.dem to w080n49.dem inclusive:

$ # Are you SURE you want to do this?
$ rm ascii/*n[5678]*
$ rm ascii/w06*
$ rm ascii/w070*
$ rm ascii/w08[1-9]*
$ rm ascii/w09*
$ rm ascii/w10*

Now, instead of 2,000 files using over 200MB, we have only 100 files using a little over 10MB. Note again that you shouldn't do this if you're planning on building scenery for the surrounding tiles as well.

OK, now it's time to chop up the DEM files into segments for TerraGear. Change back to the root of your scenery source tree (such as /usr/local/src/Scenery/, then create a work/DEM-30/ directory for the predigested DEM data to live in (US 3-arcsec DEM data, if you're using it instead, should go to work/DEM-3):

$ mkdir work/DEM-30

Now, the next part is even more OS-dependent than usual. You need to run the command demchop on each of the *.dem files in data/dem30/ascii separately. With the bash shell, I use the following (again, from the root of the scenery source tree):

$ for file in data/dem30/ascii/*.dem; do
> demchop $file work/DEM-30
> done

After the code churns away for a couple of minutes, you should find a w080n40/ directory in work/DEM-30/, containing 100 subdirectories named w071n40 to w080n49, using about 12MB of disk space.

You are now done preparing the elevation data. To build scenery, TerraGear needs only the files and directories under the work/DEM-30/; if you are tight for space, you can delete all of your working files under data/ now, before going any further (if you have a lot of space, it doesn't hurt to keep them around).


_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to