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.
geo_combine(
queries,
global_params = list(),
address = NULL,
street = NULL,
city = NULL,
county = NULL,
state = NULL,
postalcode = NULL,
country = NULL,
lat = lat,
long = long,
...
)
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'), ...)
)
a list of parameters to be used for all queries, (ex. list(address = 'address', full_results = TRUE)
)
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 address (ie. '1600 Pennsylvania Ave NW')
city (ie. 'Tokyo')
county (ie. 'Jefferson')
state (ie. 'Kentucky')
postalcode (ie. zip code if in the United States)
country (ie. 'Japan')
latitude column name. Can be quoted or unquoted (ie. lat
or "lat"
).
longitude column name. Can be quoted or unquoted (ie. long
or "long"
).
arguments passed to the geocode_combine function
tibble (dataframe)
# \donttest{
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")
)
#>
#>
#> Passing 3 addresses to the US Census batch geocoder
#> Query completed in: 0.2 seconds
#> Passing 2 addresses to the Nominatim single address geocoder
#> Query completed in: 2 seconds
#> # A tibble: 3 × 4
#> address lat long query
#> <chr> <dbl> <dbl> <chr>
#> 1 100 Main St New York, NY 40.7 -74.0 "census"
#> 2 Paris 48.9 2.32 "osm"
#> 3 Not a Real Address NA NA ""
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
)
#>
#>
#>
#> Passing 3 addresses to the ArcGIS single address geocoder
#> Query completed in: 0.4 seconds
#> Passing 3 addresses to the US Census single address geocoder
#> Query completed in: 10.7 seconds
#> Passing 3 addresses to the US Census batch geocoder
#> Query completed in: 0.2 seconds
#> $arcgis
#> # A tibble: 3 × 3
#> address lat long
#> <chr> <dbl> <dbl>
#> 1 100 Main St New York, NY 40.5 -74.3
#> 2 Paris 48.9 2.34
#> 3 Not a Real Address NA NA
#>
#> $census1
#> # A tibble: 3 × 3
#> address lat long
#> <chr> <dbl> <dbl>
#> 1 100 Main St New York, NY 40.7 -74.0
#> 2 Paris NA NA
#> 3 Not a Real Address NA NA
#>
#> $census2
#> # A tibble: 3 × 3
#> address lat long
#> <chr> <dbl> <dbl>
#> 1 100 Main St New York, NY 40.7 -74.0
#> 2 Paris NA NA
#> 3 Not a Real Address NA NA
#>
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
)
#>
#>
#> Passing 2 addresses to the ArcGIS single address geocoder
#> Query completed in: 0.7 seconds
#> Passing 2 addresses to the Nominatim single address geocoder
#> Query completed in: 2 seconds
#> # A tibble: 4 × 5
#> city country lat long query
#> <chr> <chr> <dbl> <dbl> <chr>
#> 1 Tokyo Japan 35.7 140. arcgis
#> 2 Tokyo Japan 35.7 140. osm
#> 3 New York United States 40.7 -74.0 arcgis
#> 4 New York United States 40.7 -74.0 osm
# }