Learn R Programming

bReeze (version 0.1-0)

plotMap: Plot map or satellite image

Description

Plots a map or satellite image of the met mast location.

Usage

plotMap(mast, type=c("sat", "map"), width=0.02, height=0.02, 
  plot.coords=TRUE, ...)

Arguments

mast
Met mast object created by createMast.
type
Type of the map as string. One of "sat" (satellite image) or "map" (OpenStreetMap).
width
Width of map in degrees as numeric value. Default is 0.02.
height
Height of map in degrees as numeric value. Default is 0.02.
plot.coords
If TRUE, the coordinates are placed next to the location symbol.
...
Optional graphical parameters, see below for details.

encoding

UTF-8

Optional graphical parameters

The following graphical parameters can optionally be added to customize the plot:
  • col: Vector of colours, one for each set plotted.
  • pch: Location symbol, either as integer or as single character. Seepointsfor possible values and their interpretation.
  • cex: Numeric value, giving the amount by which text on the plot should be scaled relative to the default (which is 1).

Details

This function is based on the OpenStreetMap package by Ian Fellows, which uses OpenStreetMap Mapnik tiles for maps and bing aerial for satellite image views.

See Also

createMast

Examples

Run this code
# load and prepare data
data(winddata)
set1 <- createSet(height=40, v.avg=winddata[,2])
ts <- formatTS(winddata[,1])
neubuerg <- createMast(time.stamp=ts, loc=c(49.8909,11.4017),
	desc=NULL, set1)

# plot satellite image
plotMap(neubuerg)

# plot map
plotMap(neubuerg, type="map")

# change scale and omit coordinates
plotMap(neubuerg, type="map", width=1, height=0.7, plot.coords=FALSE)
plotMap(neubuerg, type="sat", width=0.006, height=0.005, 
plot.coords=FALSE)

# change colour, symbol and text size
plotMap(neubuerg, type="sat", col="white", pch="+", cex=2)
plotMap(neubuerg, type="map", col=4, pch=7, cex=1.5)

Run the code above in your browser using DataLab