getETOPO: Get Subset ETOPO Digital elevation map

View source: R/getETOPO.R

getETOPOR Documentation

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))

Arguments

topo

A DEM matrix, ETOPO5 or ETOPO2

glat

2-vector, latitude limits

glon

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

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

Value

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

Author(s)

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

See Also

image

Examples

## 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)

GEOmap documentation built on Sept. 1, 2023, 5:09 p.m.