read.coastline {oce} | R Documentation |
Read a coastline file in mapgen, matlab, or Splus format
read.coastline(file,type=c("R","S","mapgen"),debug=FALSE)
file |
Name of file containing coastline data. |
type |
Type of file, one of "R", "S", or "mapgen" |
debug |
Set to TRUE to print information about the header, etc. |
The S and R formats are identical, and consist of two columns, lon and lat, with land-jump segments separated by lines with two NAs.
The MapGen format is of the form
# -b -16.179081 28.553943 -16.244793 28.563330BUG: the 'arc/info ungenerate' format is not yet understood.
A coastline
object containing
processing.log |
A processing log. |
data |
a list containing longitude , in decimal degrees, positive east of Greenwich, and latitude , in decimal degrees postive north of the equator. |
Dan Kelley Dan.Kelley@Dal.Ca
http://www.ngdc.noaa.gov/mgg/shorelines/shorelines.html
The generic function read.oce
provides an alternative to this.
Coastlines may be summarized with summary.coastline
and plotted with
plot.coastline
.
## Not run: library(oce) cl <- read.coastline("7404.dat") # If no plot yet: plot(cl) # To add to an existing plot: lines(cl$data$longitude, cl$data$latitude) # Note: another trick is to do something like the following, # to get issues of whether longitude is defined in (-180,180) # or (0,360) lines(cl$datas$longitude, cl$data$latitude) lines(cl$data$longitude-360, cl$data$latitude) ## End(Not run)