[R-sig-Geo] Accessing gshhs database of world coastlines

Denis Chabot chabotd at globetrotter.net
Sun Oct 16 17:28:09 CEST 2005


Hi,

Forgive me if this should be posted to another list relating to GMT  
or the gshhs database. I do not know of any such list at the moment,  
and my goal is to use the data in R anyway.

Until now I have made maps with the high-resolution world map that  
comes with PBSmapping. As explained in the user guide, these are a  
lower resolution version of the gshhs full-resolution database. But  
it is not quite good enough for maps of my part of the world. A few  
islands are missing that I'd like to have, and the details of the  
coastline are not always at a sufficient resolution.

I would have like to make my own coastline database from the original  
gshhs database, a version that would only have covered -80 to -20 in  
longitude, and 35 to 75 in latitude. I can lower resolution and clip  
to smaller areas with functions provided in PBSmapping so I'd be fine  
for most maps I have to make.

The problem is that I have next to no experience with compiling  
programs and I don't know how to install GMT (which I could use to  
extract the coastline) or the smaller programs provided just to  
interact with the database.

I thought I did not need to because a shapefile version of the  
database exists, and I have managed (with help from Roger in  
particular) to import such files in R before. But this one is huge  
(154 MB for the shp file alone). The function read.shape refuses to  
open it, telling me right way

Erreur dans read.shape("gshhs_land.shp") : unable to open file

I tried with function read.shapefile, which attempts to open the  
shapefile but never finishes (I stopped it after 12 h. Thus the  
shapefile is either a bit weird (it had more than the usual 3 files  
on the web site, I just downloaded the shp, dbf and shx files) or it  
is too big, though I have 1 GB of RAM on my Mac.

It appears I'll have to compile and learn to use the programs  
provided with that database to extract the data I want to import to R.

Has anyone done this before? Can you point me to a site that explains  
how to compile these small c programs on Mac OS X, as a first step?  
Are there instructions, somewhere, on how you'd specify the lat long  
you want to extract to an ascii file? I did not see any on the GMT site.

Maybe I'm doing all this for nothing and there is already a world  
coastline (preferably with main lakes and rivers too) database at  
high resolution available for R, beside the ones that come with maps  
(which does not allow me enough flexibility) and PBSmapping (not  
quite high enough resolution)?

Sincerely,

Denis Chabot




More information about the R-sig-Geo mailing list