Format Public Land Survey System (PLSS) components into a string that can be interpreted by the US Bureau of Land Management (BLM) PLSS encoding and decoding web service.
formatPLSS(p)
A vector of PLSS codes.
This function is typically accessed as a helper function to prepare data for use by the PLSS2LL()
function. The data.frame
'p' must contain:
id: a unique ID over rows
t: township number and direction
r: range number and direction
m: base meridian code
type: one of 'SN', 'PB', or 'UN'
and can optioninally contain:
s: section number
q: quarter section specification
qq: quarter-quarter section specification
This function requires the following packages: stringi.
# create PLSS description components
d <- data.frame(
id = 1:3,
qq = c('SW', 'SW', 'SE'),
q = c('NE', 'NW', 'SE'),
s = c(17, 32, 30),
t = c('T36N', 'T35N', 'T35N'),
r = c('R29W', 'R28W', 'R28W'),
type = 'SN',
m = 'MT20'
)
# generate formatted PLSS codes
# and save back to original data.frame
d$plssid <- formatPLSS(d)
# convert to geographic coordinates
# PLSS2LL(d)