Skip to content
Prev 621 / 29559 Next

Accessing gshhs database of world coastlines

On Sun, 16 Oct 2005, Denis Chabot wrote:

            
I have no access to OSX, I'm afraid. If you do setwd() to the directory 
where gshhs_land.shp is placed, and then list.files(pattern="shp"), is the 
file visible?`What does getwd() say when you are there? The error message 
is from:

    hSHP = SHPOpen(CHAR(STRING_ELT(shpnm,0)), "rb" );
    if( hSHP == NULL )    
	error("unable to open file");

in src/Rshapeget.c, where shpnm is the file name given to read.shape(). So 
either the compilation failed, or the file isn't there. Try 

getinfo.shape("gshhs_land.shp")

the error message there should say "Unable to open: gshhs_land.shp".
It is not a shapefile, but in GSHHS format. It is formatted as polygons. 
The problem with the shapefile as lines is that it cannot be used for 
filling land or sea, just for drawing coastlines.
OK, so I'll follow this route as well.
I think it can be done.
For unprojected it could be done, for projected like GMT is more trouble. 
If anyone would like to contribute GMTaxis() to work like GMT, please say, 
contributions welcome!
Roger