|  3DSoftware.com > Programming > File Formats > GSHHS |
|
GSHHS (WVS) File Format Changes |
| June 2007 |
|
GSHHS (Global Self-consistent Hierarchical High-resolution Shoreline) is a global-level data set consisting of the WVS data set (World Vector Shorelines) corrected with the |
| ftp://ftp.soest.hawaii.edu/pwessel/gshhs/ |
|
When this article was written (June 2007) the current GSHHS version was This article begins with a reminder that binary data files must be opened in binary mode, and then covers the difference between version |
|
Binary Mode The GSHHS data files must be opened in binary mode, not in text mode. The C language source code (in gshhs.c) opens the data file in binary mode: |
|
|
|
|
fopen is called with mode If the mode is |
|
Data Structure The GSHHS data file consists of blocks of data without a file header. Each data block has its own header. Each data block stores the vertices of a polygon. The polygon is the coastline of a land mass or water body. The version |
|
|
|
|
The newer version |
|
|
|
|
The new variable flag replaces the struct elements level, version, greenwich and source, each of which become a byte in the new |
|
|
|
|
We recommend inserting a version check where these |
|
|
|
|
That would be the second version check. The first version check, earlier in the source code, checks for the need to do byte swapping. In that check, if the version is incorrect, it is assumed that byte swapping is needed. The second check would occur after performing byte swapping (if needed) of the struct elements. |
|
Copyright © 2008 by 3D Software. All rights reserved. 3D Software, P.O. Box 221190, Sacramento CA 95822 USA www.3DSoftware.com Contact us |
| Thursday, 20-Nov-2008 13:37:20 GMT |