gshhs (1) - Linux Man Pages

gshhs: Extract ASCII listings from binary GSHHS or WDBII data files


gshhs - Extract ASCII listings from binary GSHHS or WDBII data files


gshhs binaryfile.b [ -Iid ] [ -L ] [ -M ] > asciifile.txt


gshhs reads the binary coastline (GSHHS) or political boundary or river (WDBII) files and extracts an ASCII listing. It automatically handles byte-swabbing between different architectures. Optionally, only segment header info can be displayed. The header info has the format ID npoints hierarchical-level source area f_area west east south north container ancestor, where hierarchical levels for coastline polygons go from 1 (shoreline) to 4 (lake inside island inside lake inside land). Source is either W (World Vector Shoreline) or C (CIA World Data Bank II); lower case is used if a lake is a river-lake. The west east south north is the enclosing rectangle, area is the polygon area in km^2 while f_area is the actual area of the ancestor polygon, container is the ID of the polygon that contains this polygon (-1 if none), and ancestor is the ID of the polygon in the full resolution set that was reduced to yield this polygon (-1 if full resolution). For line data the header is simply ID npoints hierarchical-level source west east south north
GSHHS or WDBII binary data file as distributed with the GSHHS data supplement. Any of the 5 standard resolutions (full, high, intermediate, low, crude) can be used.
Only output information for the polygon that matches id [default outputs all polygons].
Only output a listing of polygon or line segment headers [default outputs headers and data records].
Start all header records with the GMT multiple segment indicator '>' [Default uses P for polygons and L for lines].


To convert the entire intermediate GSHHS binary data to ASCII, run

gshhs gshhs_i.b > gshhs_i.txt

To only get a listing of the headers for the river data set at full resolution, try

gshhs wdb_rivers_f.b -L > riverlisting.txt


While the GSHHS data is organized as a set of closed polygons, the rivers and boundary data are just a set of line segments in no particular order. Thus, it is not possible to extract information pertaining to just one river or one country.


GMT(1), gshhs_dp(1) gshhstograss(1)