Skip to contents

Using a given coordinate, this function will generate a circle of a given radius around the point and fill the circle with a gradient of values in a conical pattern. By default, the interpolated values range from zero to one, with values of one point in the direction of the specified heading.

Usage

radar_cone(
  pt,
  radius,
  heading,
  theta = 0,
  res = 500,
  mask = TRUE,
  invert = FALSE,
  maxvalue = 1
)

Arguments

pt

A single (X,Y) coordinate of class sfc_POINT (created by the sf package), where the CRS is a projected coordinate system.

radius

Numeric. Distance in meters from the point pt to draw the circle radius.

heading

Numeric. Heading, in compass degrees, which to interpolate values from.

theta

Numeric (0 to 360). Angle, in degrees, indicating the amount of the circle that should be taken up by the maxvalue. For example, if you want to create a wedge where 1/3 of the circle == 1, set theta = 120. Default 0.

res

Numeric. Resolution, in meters, of the output raster. Default 500.

mask

Boolean (TRUE/FALSE). Should the output be masked to a circle shape (rather than square)? Default TRUE.

invert

Boolean (TRUE/FALSE). Should the values of the output cone be inverted, such that the values in the direction of the heading are 0 rather than 1? Default FALSE.

maxvalue

Numeric. Maximum value of the interpolated values of the cone. The interpolated values run from 0 to maxvalue. Default 1.

Value

A SpatRaster object

Details

When using this function with spatial features, ensure your data are projected in an equal-area coordinate system. This function assumes meters as the default unit.

This function was originally developed with the intention of generating 'cones of probability' for estimating the dispersal of birds flying across a landscape. Radar stations based across British Columbia, Canada, collected data on the mean headings of birds flying across a radar station. These headings indicate the more likely direction birds will be flying to, while headings in the opposite direction indicate areas the birds are flying away from. Thus, the gradient of values from 0 (flying away) to 1 (flying towards) was developed around each given radar station using this function.

Examples