getETOPO function

Get Subset ETOPO Digital elevation map

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

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

Returns

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

Author(s)

Jonathan M. Leesjonathan.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)
  • Maintainer: Jonathan M. Lees
  • License: GPL (>= 2)
  • Last published: 2024-07-09

Useful links