location_getCensusBlock: Get census block data from the FCC API

Description Usage Arguments Value References Examples

View source: R/location_getCensusBlock.R

Description

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:

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.

Usage

1
2
3
4
5
6
location_getCensusBlock(
  longitude = NULL,
  latitude = NULL,
  censusYear = 2010,
  verbose = TRUE
)

Arguments

longitude

Single longitude in decimal degrees E.

latitude

Single latitude in decimal degrees N.

censusYear

Year the census was taken.

verbose

Logical controlling the generation of progress messages.

Value

List of census block/county/state data.

References

https://anypoint.mulesoft.com/exchange/portals/fccdomain/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

MazamaLocationUtils documentation built on Jan. 17, 2022, 1:06 a.m.