rgl.Map: Plot a map in an rgl window

Description Usage Arguments Details Value Note Author(s) See Also Examples

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

1

Arguments

Map

A Map object

which

Vector indicating the subset of polygons to plot.

...

Additional arguments passed on to rgl.lines.

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.

Value

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

Note

This function is still beta level software (some extra lines show up). This needs to be updated to use the new spatial objects, you can use it as an idea, but probably won't work directly.

Author(s)

Greg Snow 538280@gmail.com

See Also

rgl in package rgl, plot.Map in package maptools

Examples

1
2
3
4
5
6
7
8
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')
}

Example output



TeachingDemos documentation built on April 14, 2020, 6:26 p.m.