TeachingDemos (version 2.10)

rgl.Map: Plot a map in an rgl window

Description

Plots a map (from a Map object from package maptools) on a unit sphere in an rgl window that can then be interactively rotated.

Usage

rgl.Map(Map, which, ...)

Arguments

Map

A Map object

which

Vector indicating the subset of polygons to plot.

Additional arguments passed on to rgl.lines.

Value

There is no return value, this function is run for its side effect.

Details

This assumes that the map is cordinates in degrees and plots the map on a unit sphere in an rgl window making a globe. You can then rotate the globe by clicking and dragging in the window.

See Also

rgl in package rgl, plot.Map in package maptools

Examples

Run this code
# NOT RUN {
if(interactive()){
# assumes that the time zone shape files have been downloaded
# from: http://openmap.bbn.com/data/shape/timezone/

tz <- maptools:::read.shape('WRLDTZA')
rgl.Map(tz)
rgl.spheres(0,0,0,.999, col='darkblue')
}
# }

Run the code above in your browser using DataCamp Workspace