3. Usage

3.1. Extract data from GSHHS dat file

GSHHS data is very huge, so you must extract necessary data from data file.

Start command prompt, then change directory (folder):

	cd folder name in which AutoCoast is installed
      

Next, extract data with GshhsExtractor tool:

	GshhsExtractor [options] GSHHS_data_file_name min_longitude max_longitude min_latitude max_latitude
      

There are 4 types of GSHHS data files. You should use 'gshhs_f.b' file which is most detailed one.

Exsample: To extract data around Japan, type 'GshhsExtractor gshhs_f.b 125 150 25 50'.

You can use minus value for west/south hemisphere.

[Caution] Caution

You can't extract data crossing greenwich.

You can specify some options (usually, you don't need them):

3.1.1. -n : Suppress polygon smoothing

By default, GshhsExtractor smoothes shoreline polygon, because GSHHS shore lines are a bit 'rough'.

To suppress this, specify '-n'.

3.1.2. -i : Exclude some polygons

You can 'exclude' some GSHHS polygons to speed up processing by specifying the maximun number of the polygon. For example, you can exclude No.0 polygon (Eurasia) with '-i 0' option.

3.2. Generate scenery data

Generate scenery data with AutoCoast tools:

	autocoast [options] min_x min_y max_x max_y
      

You must specify 'cell' range. Cell is a unit of coast line scenery. There are 768 x 512 = 393,216 cells on the surface of the globe.

You can calculate cell coordinates with following expressions:

  • X = ([East longigude] + 180) / 360 x 768

  • Y = (90 - [North latitude]) / 180 x 512

You can use the calculator with Coast Line Maker.

Example:

	autocoast 675 156 676 158
      

You can specify following options:

3.2.1. -d : Specify latitude/longitude in degree

You can specify latitude/longitude in degree instead of cell coordinates.

3.2.2. -l : Specify width of land area

This option tells the autocoast tool to fill some areas within each coast line. You should this option when you see unexpected 'water' within land.

A cell contains 32 x 32 areas. Specify 'width' of land area along shore line. Default value is 1.

3.2.3. -t : VTP texture name

Specify VTP polygon texture name to draw shore line polygon.

Default value is "1029" (Sandy beach with wave effect).

3.2.4. -w : VTP texture width

Specify VTP polygon width in meters.

Default value is 80.

3.2.5. Example

	  autocoast -l 1 -t 1032 -w 50 -d 135 55 155 30
	

3.3. Compilation

To generate BGL file, you must compile the generated *.asm file. Execute compile.bat:

	compile.bat