R/location_getCensusBlock.R
location_getCensusBlock.Rd
The FCC Block API is used get census block, county, and state FIPS associated with
the longitude
and latitude
. The following list of data
is returned:
stateCode
countyName
censusBlock
The data from this function should be considered to be the gold standard for state and county. i.e. this information could and should be used to override information we get elsewhere.
location_getCensusBlock(
longitude = NULL,
latitude = NULL,
censusYear = 2010,
verbose = TRUE
)
Single longitude in decimal degrees E.
Single latitude in decimal degrees N.
Year the census was taken.
Logical controlling the generation of progress messages.
List of census block/county/state data.
# \donttest{
library(MazamaLocationUtils)
# Fail gracefully if any resources are not available
try({
# Wenatchee
lon <- -120.325278
lat <- 47.423333
censusList <- location_getCensusBlock(lon, lat)
str(censusList)
}, silent = FALSE)
#> List of 3
#> $ stateCode : chr "WA"
#> $ countyName : chr "Chelan"
#> $ censusBlock: chr "530079613023026"
# }