calcMidRange: Calculate the Midpoint of the X/Y Ranges of Polygons

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PBSmapping.r

Description

Calculate the midpoint of the X/Y ranges of polygons found in a PolySet.

Usage

1
calcMidRange (polys, rollup = 3)

Arguments

polys

PolySet to use.

rollup

level of detail in the results; 1 = PIDs only, 2 = outer contours only, and 3 = no roll-up.

Details

If rollup equals 1, the results contain a mean range for each unique PID only. When it equals 2, they contain entries for outer contours only. Finally, setting it to 3 prevents roll-up, and they contain a mean range for each unique (PID, SID).

Value

PolyData with columns PID, SID (may be missing), X, and Y.

Author(s)

Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10

See Also

calcArea, calcCentroid, calcLength, calcSummary.

Examples

1
2
3
4
5
6
7
local(envir=.PBSmapEnv,expr={
  #--- load the data (if using R)
  if (!is.null(version$language) && (version$language=="R"))
    data(nepacLL,envir=.PBSmapEnv)
  #--- calculate and print the centroids for several polygons
  print(calcMidRange(nepacLL[is.element(nepacLL$PID,c(33,39,47)),]))
})

PBSmapping documentation built on Jan. 15, 2021, 3:41 p.m.