This function takes components of addresses and returns the Geoclient response as a tibble. The house number, street name, and one of either borough or Zip code are required. The address components can be provided either in separate vectors as named arguments or with a dataframe and column names containing each component. The Geoclient API's app ID and key can either be provided directly as arguments, or you can first use geoclient_api_keys() to add them to your .Renviron file so they can be called securely without being stored in your code.

geo_intersection_data(.data, cross_street_1, cross_street_2, borough,
  cross_street_2_borough = NULL, compass_direction = NULL, id = NULL,
  key = NULL, rate_limit = TRUE)

geo_intersection(cross_street_1, cross_street_2, borough,
  cross_street_2_borough = NULL, compass_direction = NULL, id = NULL,
  key = NULL, rate_limit = TRUE)

Arguments

.data

Dataframe containing columns to be used for other arguments.

cross_street_1

The first cross street of the intersection, as either a vector of street names, or a bare column name of the field if a dataframe is provided.

cross_street_2

The second cross street of the intersection, as either a vector of street names, or a bare column name of the field if a dataframe is provided.

borough

The name of the borough of the the first cross street, or the entire intersection if cross_street_2_borough is not provided. The argument can be provided as either a vector or a bare column name of the borough field if a dataframe is provided.

cross_street_2_borough

Optionally, the name of the borough of the second cross street if it differs from the first cross street. The argument can be provided as either a vector or a bare column name of the borough field if a dataframe is provided.

compass_direction

Optionally, the direction indicating a side of the street to request information about only one side of the street. The argument can be provided as either a vector or a bare column name of the field if a dataframe is provided. The valid values of are "N", "E", "S", or "W"

id

The API app ID provided to you from the NYC Developer Portal formated in quotes. Defaults to NULL and your key is accessed from your .Renviron.

key

The API app key provided to you from the NYC Developer Portal formated in quotes. Defaults to NULL and your key is accessed from your .Renviron.

rate_limit

Whether you would like to limit the rate of API requests in adherence to Geoclient's Service Usage Guidelines. See ?geoclient for more information.

Details

For more details see the Geoclient Documentation's guide to making intersection requests, interpreting the Geosupport return codes, the data returned by geo_intersection, and a complete data dictionary for all possible data elements returned by any geoclient function.

Examples

# NOT RUN { geoclient_api_keys("1a2b3c4", "9d8f7b6wh4jfgud67s89jfyw68vj38fh") geo_intersection("macdougal st", "w 3rd st", "mn") df <- tibble::tribble( ~st_1, ~st_2, ~boro, "macdougal st", "w 3rd st", "mn", "Lexington Ave", "125th Steet", "Manhattan" ) geo_intersection(df, cross1, cross2, boro) library(dplyr) bind_cols(df, geo_intersection(df, cross1, cross2, boro)) mutate(.data, lion_node_num = geo_intersection(st_1, st_2, boro)[["lionNodeNumber"]]) # }