GEOTOPO function

Topographic Plot of geographic region

Topographic Plot of geographic region

Extract subset of a topographic database, interpolate and plot using the persp program.

GEOTOPO(TOPO, PLOC, PROJ, calcol=NULL, nx=500, ny=500, nb = 4, mb = 4, hb = 8, PLOT=TRUE)

Arguments

  • TOPO: list of x,y,z for a DEM
  • PLOC: Location list, includes vectors LON and Lat
  • PROJ: projection
  • calcol: color table for coloring elevations above sea level
  • nx: number of points in x grid, default=500
  • ny: number of points in y grid, default=500
  • nb: see function mba.surf, default = 4
  • mb: see function mba.surf, default = 4
  • hb: see function mba.surf , default= 8
  • PLOT: logical, TRUE=plot a map and return color map

Details

The return matrix PMAT is a rotation matrix used for adding geographic (projected) data onto the perspective plot.

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

  • PMAT: Matrix from persp, used for adding other geographic information

  • xo: x-coordinates

  • yo: y-coordinates

  • IZ: interpolated elevations

  • Cmat: matrix of RGB Colors

  • Dcol: dimensions of Cmat

Note

If PLOT is false the transform matrix PMAT and the color mapping matrix Cmat will be returned as NA. To create these for future plotting, use TOPOCOL or LandSeaCol functions. TOPOCOL simply assigns values above sea level with one color scale and those below with under water colors. LandSeaCol requires a coastal map and fills in land areas with terrain colors and sea areas with blue palette colors.

Author(s)

Jonathan M. Lees<jonathan.lees.edu>

See Also

subsetTOPO, TOPOCOL, LandSeaCol, settopocol, subsetTOPO, persp, DOTOPOMAPI

Examples

## Not run: library(geomapdata) #### need to download and install ETOPO data ### data(ETOPO5) load(ETOPO5) PLOC=list(LON=c(137.008, 141.000),LAT=c(34.000, 36.992), x=c(137.008, 141.000), y=c(34.000, 36.992) ) PROJ = setPROJ(type=2, LAT0=mean(PLOC$y) , LON0=mean(PLOC$x) ) COLS = settopocol() JMAT = GEOTOPO(ETOPO5, PLOC, PROJ, COLS$calcol, nx=1000, ny=1000, nb=8, mb=8, hb=12, PLOT=TRUE) ############ this plot can be duplicated by using the output or GEOTOPO PMAT = persp(JMAT$xo, JMAT$yo, JMAT$IZ$z, theta = 0, phi = 90, r=4000, col=JMAT$Cmat[1:(JMAT$Dcol[1]-1), 1:(JMAT$Dcol[2]-1)] , scale = FALSE, ltheta = 120, lphi=60, shade = 0.75, border = NA, expand=0.001, box = FALSE ) ## End(Not run)
  • Maintainer: Jonathan M. Lees
  • License: GPL (>= 2)
  • Last published: 2024-07-09

Useful links