Learn R Programming

GEOmap (version 2.5-11)

getETOPO: Get Subset ETOPO Digital elevation map

Description

Extract from ETOPO5 or ETOPO2 data a rectangular subset of the full data.

Usage

getETOPO(topo, glat = c(-90, 90), glon = c(0, 360))

Value

Returns a matrix with attributes in lat-lon that are correct for usage in image or other R imaging programs.

Arguments

topo

A DEM matrix, ETOPO5 or ETOPO2

glat

2-vector, latitude limits

glon

2-vector, longitude limits (these are converted 0-360

Author

Jonathan M. Lees<jonathan.lees@unc.edu>

Details

ETOPO2 and ETOPO5 are stored in a strange way: the lons are okay the latitudes are upside down.

ETOPO5 or ETOPO2 can be downloaded from and installed using these links: http://leesj.sites.oasis.unc.edu/FETCH/GRAB/RPACKAGES/ETOPO2.RData and http://leesj.sites.oasis.unc.edu/FETCH/GRAB/RPACKAGES/ETOPO5.RData

See Also

image

Examples

Run this code
if (FALSE) {
library(geomapdata)
###  Download and install ETOPO Data
##    data(ETOPO5)
load(ETOPO5)
glat =c(45.4, 49)
glon = c(235, 243) 
b5 = getETOPO(ETOPO5, glat, glon)
image(x=attr(b5, 'lon'), y=attr(b5,'lat'), z=b5, col=terrain.colors(100) )
contour(   x=attr(b5, 'lon'), y=attr(b5,'lat'), z=b5, add=TRUE)
}

Run the code above in your browser using DataLab