background: Configure a Map Background

backgroundR Documentation

Configure a Map Background

Description

A simple function to collect data for a map background (returns class "Background") and methods operating an such a collection.

Usage

background(extent, waters = TRUE, reliefmap = TRUE, gridlines = TRUE,
           pretty = FALSE, add = 0, tol = 0.005, strahler = 4, score = 3, ecrins2 = FALSE)

## S4 method for signature 'Background'
plot(x, mar = rep(0,4), plain = FALSE, lwd.rivers = 1, add = FALSE,
    frame = TRUE, col,  ...)

## S4 method for signature 'Background'
show(object)

## S4 method for signature 'Background'
layers(object, ...)

## S4 method for signature 'Background'
grid(object)

## S4 method for signature 'Background'
margin(object, ...)

## S4 method for signature 'Background'
labelmargin(object, ...)

## S4 method for signature 'Background'
pdf(object, file, width, height, dingbats = FALSE, ...)

Arguments

extent

Extent object as defined in raster. See also pretty.

waters

Include water bodies (rivers and lakes) from package sabotagdata. See ecrins.

ecrins2

Use bigger dataset (Austria and neighbours) See ecrins2.

reliefmap

Include a colored relief map water from package sabotagdata. See relief.

gridlines

Include grid as lines additional to polygon grid. Defaults to ⁠TRUE⁠.

pretty

Recalculate extent using pretty.

add

Argument passed on to ⁠pretty⁠ or add to existing plot ⁠plot⁠.

tol

Simplify geometries using package rgeos. See gSimplify.

strahler

Subset rivers with Strahler stream order. See rivers.

score

Subset lakes by lake score.

x, object

⁠Background⁠ object.

mar

Add margins (see par). The default is to set all margins to zero.

plain

Do not plot anything but open plotting window.

frame

Draw a frame around figure.

col

Color of water bodies. If missing an internal default is applied.

add
lwd.rivers

Linewidth for rivers. Multiplier to normalized strahler values.

file, width, height, dingbats

Arguments for pdf. See pdf.

...

To be passed to methods. Experimental. ⁠resolution⁠ should work.

Details

  • ⁠background⁠: returns an object where all layers are cropped to a common extent. These layers can be accessed by ⁠layers(object)⁠, the method returns a list. ⁠layers(x)$grid⁠ returns what ⁠floragrid⁠ calculated on the input extent.

  • ⁠layers⁠: is a shortcut to return ⁠slot(object, "layers")⁠. This method should be used to return the content of this slot.

  • ⁠grid⁠: returns the grid of objects of class ⁠background⁠.

  • ⁠margins⁠: returns the outer margin of ⁠floragrid⁠ computed on inherited extent of object (see extent).

  • ⁠labelmargin⁠: returns an object (class ⁠SpatialPointsDataFrame⁠) that can be used to plot margin labels. Row and column labels are computed according to defaults of ⁠margin⁠.

  • ⁠pdf⁠ creates PDF output.

Value

An object of class ⁠background⁠. A list with elements of class Spatial*.

Author(s)

Roland Kaiser

See Also

sabotagdata

Examples

x <- background(extent(12,13,47,48))
plot(x)

kardinal-eros/sabotag-tools documentation built on Feb. 6, 2025, 1:12 a.m.