Miscellaneous Scenery Tools

From Silent Wings Wiki
Jump to: navigation, search

build_config.pl

This perl script will generate terrain block directories with config files for a given area.

Usage:

 build_config.pl <template file> <min latitude> <min longitude> <max latitude> <max longitude>

Example:

 $GGFX/etc/build_config.pl terrain.tpl -36 -72 -30 -68  

The template file must be set up with paths to the various data sources, both DEM data for the terrain generator and image data for the texture mapper can be put into this file.

See the included terrain.tpl file for an example.

Both the perl script and the template file are included in the terrain tools distribution, but they can also be downloaded directly:

build_config.pl terrain.tpl

chop.py

chop.py is a Python script that chops up a GeoTIFF (georeferenced TIFF image) into a grid of equal size pieces.
This is particularly useful if you need to touch up a large aerial or satellite image in a graphics application such as GIMP or Photoshop and one doesn't have enough RAM for the entire image to fit into.
chop.py uses utilities from the GDAL library which must be installed.

chop.py has two basic modes of operation : size and pieces.

To chop an image into pieces with each piece having a maximum size of 5000 by 4000 pixels :

chop.py -s 5000 4000 input.tif output.tif

To chop an image into 2 horizontal by 4 vertical pieces :

chop.py -p 2 4 input.tif output.tif

If you would like to create TIFF World files for the output images pass the -t or -tifw program argument. That will ensure that when you modify and save the images in an application that doesn't honor the georeferencing tags (such as GIMP and Photoshop) the georeferencing information will not be lost.

If you would like the pieces to have an overlap so that they can be seamlessly mosaiced back together again you can specify the overlap in pixels with the -o or --overlap program argument.

Full example with maximum piece size of 3000 by 3000 pixels, 10 pixel overlap between pieces and TIFF World file creation :

chop.py -s 3000 3000 -t -o 10 input.tif output.tif