geo_combine: Combine multiple geocoding queries

View source: R/geocode_combine.R

geo_combineR Documentation

Combine multiple geocoding queries

Description

Passes address inputs in character vector form to the geocode_combine function for geocoding.

Note that address inputs must be specified for queries either with the queries parameter (for each query) or the global_params parameter (for all queries). For example global_params = list(address = 'address') passes addresses provided in the address parameter to all queries.

Usage

geo_combine(
  queries,
  global_params = list(),
  address = NULL,
  street = NULL,
  city = NULL,
  county = NULL,
  state = NULL,
  postalcode = NULL,
  country = NULL,
  lat = lat,
  long = long,
  ...
)

Arguments

queries

a list of queries, each provided as a list of parameters. The queries are, executed by the geocode function in the order provided., (ex. list(list(method = 'osm'), list(method = 'census'), ...))

global_params

a list of parameters to be used for all queries, (ex. list(address = 'address', full_results = TRUE))

address

single line address (ie. '1600 Pennsylvania Ave NW, Washington, DC'). Do not combine with the address component arguments below (street, city, county, state, postalcode, country).

street

street address (ie. '1600 Pennsylvania Ave NW')

city

city (ie. 'Tokyo')

county

county (ie. 'Jefferson')

state

state (ie. 'Kentucky')

postalcode

postalcode (ie. zip code if in the United States)

country

country (ie. 'Japan')

lat

latitude column name. Can be quoted or unquoted (ie. lat or "lat").

long

longitude column name. Can be quoted or unquoted (ie. long or "long").

...

arguments passed to the geocode_combine function

Value

tibble (dataframe)

See Also

geocode_combine geo geocode

Examples



options(tidygeocoder.progress_bar = FALSE)
example_addresses <- c("100 Main St New York, NY", "Paris", "Not a Real Address")

geo_combine(
  queries = list(
    list(method = "census"),
    list(method = "osm")
  ),
  address = example_addresses,
  global_params = list(address = "address")
)

geo_combine(
  queries = list(
    list(method = "arcgis"),
    list(method = "census", mode = "single"),
    list(method = "census", mode = "batch")
  ),
  global_params = list(address = "address"),
  address = example_addresses,
  cascade = FALSE,
  return_list = TRUE
)

geo_combine(
  queries = list(
    list(method = "arcgis", address = "city"),
    list(method = "osm", city = "city", country = "country")
  ),
  city = c("Tokyo", "New York"),
  country = c("Japan", "United States"),
  cascade = FALSE
)


jessecambon/tidygeocoder documentation built on Jan. 26, 2023, 4:03 p.m.