GEOTOPO {GEOmap} | R Documentation |
Extract subset of a topographic database, interpolate and plot using the persp program.
GEOTOPO(TOPO, PLOC, PROJ, calcol=NULL, npoints=500)
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 |
npoints |
number of points in x-y grid, default=500 |
The return matrix PMAT is a rotation matrix used for adding geographic (projected) data onto the perspective plot.
PMAT |
Matrix from persp, used for adding other geographic information |
xo |
x-coordinates |
yo |
y-coordinates |
IZ |
interpolated elevations |
Mollist |
matrix of RGB Colors |
dMOL |
dimensions of Mollist |
Jonathan M. Lees<jonathan.lees.edu>
subsetTOPO, settopocol, subsetTOPO, persp, DOTOPOMAPI
library(geomapdata) data(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) ############ 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$Mollist[1:(JMAT$dMOL[1]-1), 1:(JMAT$dMOL[2]-1)] , scale = FALSE, ltheta = 120, lphi=60, shade = 0.75, border = NA, expand=0.001, box = FALSE )