Skip to content
Prev 4365 / 29559 Next

problem to convert gshhs to shapefile with R

On Thu, 16 Oct 2008, Yvan Le Bras wrote:

            
... so it would make sense to read the documentation (and/or the code) of 
Rgshhs(). There you find that the function returns a list, with a 
component called SP. Look in the examples to see exactly how this works. 
All the other components are intermediate objects possibly needed for 
debugging the running of the function, which is vulerable to changes in 
versions of GSHHS.

The output objects are either SpatialPolygons or SpatialLines objects, 
which need to be complemented with a data frame with at least one 
variable, and with row.names identical to the Lines or Polygons objects' 
ID slots, to make Spatial*DataFrame objects, which can then be exported as 
shapefiles.

It is always a good idea not to "think" too much, but rather to read the 
documentation and in particular study the examples provided.

Roger