Get Subset ETOPO Digital elevation map
Extract from ETOPO5 or ETOPO2 data a rectangular subset of the full data.
getETOPO(topo, glat = c(-90, 90), glon = c(0, 360))
topo
: A DEM matrix, ETOPO5 or ETOPO2glat
: 2-vector, latitude limitsglon
: 2-vector, longitude limits (these are converted 0-360ETOPO2 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
Returns a matrix with attributes in lat-lon that are correct for usage in image or other R imaging programs.
Jonathan M. Leesjonathan.lees@unc.edu
image
## Not run: 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) ## End(Not run)
Useful links