DefineAreaPosition: Define Area Code Positions

View source: R/StoxBaselineFunctions.R

DefineAreaPositionR Documentation

Define Area Code Positions

Description

Define positions for areas of a spatial coding system.

Usage

DefineAreaPosition(
  processData,
  DefinitionMethod = c("ResourceFile", "StratumPolygon"),
  FileName = character(),
  StratumPolygon,
  UseProcessData = F
)

Arguments

processData

AreaPosition as returned from this function.

DefinitionMethod

'ResourceFile' or 'StratumPolygon', see details.

FileName

path to resource file

StratumPolygon

StratumPolygon to extract area positions from.

UseProcessData

If TRUE, bypasses execution of function and returns existing 'processData'

Details

Defines an association between area codes and positions that represent that area code. For example an area code could be associated with the centre of mass of the area, or some other point within the area. This may be useful for providing approximate coordinates when locations are identified by area codes. The soruces of the area-position association may be a table or a appropriately formatted polygon-definition (StratumPolygon).

For DefinitionMethod 'ResourceFile': Definitions are read from a tab separated, UTF-8 encoded file with headers. Columns defined as:

Column 1: 'Area'

Area code (key)

Column 2: 'Location'

optional subdivision of area. If provided, positions for missing locations should be encoded as well.

Column 3: 'Latitude'

WGS84 Latitude, decimal degrees

Column 4: 'Longitude'

WGS84 Longitude, decimal degrees

For DefinitionMethod 'StratumPolygon': Definitions are extracted from a StratumPolygon: 'Area' in AreaPosition is derived from the column 'StratumName' in StratumPolygon. 'Location' in AreaPosition is encoded as missing. 'Latitude' and 'Longitude' in AreaPosition are the centroids set for each polygon in StratumPolygon. Note that for oddly shaped polygons (concave polygons) the centroid may lay outside the area.

Value

AreaPosition.

See Also

SetAreaPositionsBiotic and AddAreaPositionStoxLanding for adding positions to data.


StoXProject/RstoxFDA documentation built on Nov. 12, 2024, 3:42 a.m.