plotmap {kfsst}R Documentation

Plot land area on a map with colored polygons

Description

Plots a map within given rectangular region showing land areas as colored polygons. Requires the mapping utility GMT.

Usage

plotmap(x1, x2, y1, y2, resolution=3,
        grid=FALSE, add=FALSE, save=FALSE,
        landcolor="darkgreen", seacolor="lightblue", 
        zoom=FALSE)

Arguments

x1 Longitude of lower left corner of rectangle
x2 Longitude of upper right corner of rectangle
y1 Latitude of lower left corner of rectangle
y2 Latitude of upper right corner of rectangle
resolution Map resolution, integer: 1 (highly detailed) to 5 (crude)
grid Whether to plot grid lines on map
add Whether to add polygons to an existing plot
save Whether to return matrix of polygons
landcolor Color of polygons
seacolor Color of ocean
zoom Whether to start in interactive zoom mode

Details

A map is plotted with polygons clipped at borders of map region.

If the function is started in zoom mode two left-clicks on the map will zoom it to the rectangle spanned by the two points. This zooming is repeated until a right-click on the map is done.

Value

Value is NULL unless save is TRUE, in which case a 2-column matrix is returned containing latitude and longitude coordinates of the polygon vertices. Polygons are separated by NAs in both columns.

Author(s)

Pierre Kleiber, and Anders Nielsen anders.nielsen@hawaii.edu

See Also

kfsst

Examples

  #This function requires GMT to be installed. If you have it try typing:
  #  plotmap(8,13,53,58,res=1,zoom=TRUE)

[Package kfsst version 0.2 Index]