Skip to content

Commit

Permalink
Merge pull request #185 from jessecambon/remove-deprecated
Browse files Browse the repository at this point in the history
Remove deprecated parameters and functions
  • Loading branch information
jessecambon authored Dec 12, 2022
2 parents fc263f8 + 705d29b commit 430215b
Show file tree
Hide file tree
Showing 39 changed files with 296 additions and 736 deletions.
9 changes: 7 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ Authors@R:
family = "Possenriede",
email = "[email protected]",
role = "aut",
comment = c(ORCID = "0000-0002-6738-9845"))
comment = c(ORCID = "0000-0002-6738-9845")),
person(given = "Otto",
family = "Hansen",
email = "[email protected]",
role = "ctb",
comment = c(ORCID = "0000-0002-4618-5667"))
)
Description: An intuitive interface for getting data from geocoding services.
License: MIT + file LICENSE
Expand Down Expand Up @@ -50,5 +55,5 @@ VignetteBuilder:
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.2
Language: en-US
13 changes: 0 additions & 13 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,7 @@
export(extract_results)
export(extract_reverse_results)
export(geo)
export(geo_arcgis)
export(geo_bing)
export(geo_cascade)
export(geo_census)
export(geo_combine)
export(geo_geocodio)
export(geo_google)
export(geo_here)
export(geo_iq)
export(geo_mapbox)
export(geo_mapquest)
export(geo_opencage)
export(geo_osm)
export(geo_tomtom)
export(geocode)
export(geocode_combine)
export(get_api_query)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tidygeocoder (development version)

### Bug Fixes and Enhancements

- Changed the default `min_time` (minimum seconds elapsed per query) value to 1 (60 queries per minute) for the Location IQ service ([#166](https://github.com/jessecambon/tidygeocoder/issues/166)).
- Updated default Geocodio API URL from version 1.6 to 1.7.
- Fixed code and documentation that incorrectly referred to `mapquest_open` as `mapbox_open`.
Expand All @@ -9,6 +11,14 @@
- The ArcGIS service now returns all available parameters by default ([#177](https://github.com/jessecambon/tidygeocoder/issues/177), [#ottothecow](https://github.com/ottothecow))
- Fixed a bug where the Geocodio service did not pass the correct address component parameter names ([#178](https://github.com/jessecambon/tidygeocoder/issues/178), [@ottothecow](https://github.com/ottothecow)).

### Removed Deprecated Features


- Removed the `"cascade"` method for `geo()`. Use `geo_combine()` or `geocode_combine()` instead.
- Removed deprecated functions: `geo_census()` `geo_osm()` `geo_geocodio()` `geo_iq()` `geo_google()` `geo_opencage()` `geo_mapbox()` `geo_here()` `geo_tomtom()` `geo_mapquest()` `geo_bing()` `geo_arcgis()` `geo_cascade()`. Use the `geo()` function instead.
- Removed deprecated parameters for `geo()` and `reverse_geo()`: `iq_region`, `geocodio_v`, `param_error`, `mapbox_permanent`, `here_request_id`, `mapquest_open`. Use the `api_options` parameter instead.
- Removed deprecated parameters for `geo()`: `cascade_order`, `batch_limit_error`, `return_type`. Instead of `return_type`, use the `api_options` parameter. The `cascade_order` and `batch_limit_error` parameters are no longer needed now that the `"cascade"` method is removed.


# tidygeocoder 1.0.5

Expand Down
2 changes: 1 addition & 1 deletion R/batch_geocoding.R
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ batch_mapquest <- function(unique_addresses, lat = "lat", long = "long", method
mode = "single", full_results = full_results,
custom_query = custom_query, verbose = verbose,
api_url = api_url, limit = limit,
mapquest_open = api_options[["mapquest_open"]]
api_options = list(mapquest_open = api_options[["mapquest_open"]])
)

# rename lat/long columns
Expand Down
76 changes: 33 additions & 43 deletions R/documentation.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ get_api_doc_bullets <- function() {
return(
paste0(
"- [", tidygeocoder::api_info_reference$method_display_name,
"](", tidygeocoder::api_info_reference$api_documentation_url, ")"
"](", tidygeocoder::api_info_reference$api_documentation_url, ")",
collapse = "\n"
)
)
}
Expand All @@ -65,7 +66,8 @@ get_api_usage_bullets <- function() {
return(
paste0(
"- [", tidygeocoder::api_info_reference$method_display_name,
"](", tidygeocoder::api_info_reference$api_usage_policy_url, ")"
"](", tidygeocoder::api_info_reference$api_usage_policy_url, ")",
collapse = "\n"
)
)
}
Expand Down Expand Up @@ -132,67 +134,54 @@ get_method_documentation <- function(reverse) {
}

return(
c(
paste(c(
method_intro,
sapply(methods_to_list, get_method_bullet, USE.NAMES = FALSE)
sapply(methods_to_list, get_method_bullet, USE.NAMES = FALSE)), collapse = "\n")
)
)
}

get_batch_limit_documentation <- function(reverse) {
terms <- get_coord_address_terms(reverse)
return(
c(
paste0(c("limit to the number of ", terms$input_plural, " in a batch geocoding query."), collapse = ""),
"Defaults to the value in [batch_limit_reference] if not specified."
)
)
}

get_batch_limit_error_documentation <- function(reverse) {
terms <- get_coord_address_terms(reverse)
cascade_message <- if (reverse == FALSE) " This is reverted to FALSE when using the cascade method." else ""

return(
c(
paste0(c("if TRUE then an error is thrown if the number of ", terms$input_plural, " exceeds the batch limit."), collapse = ""),
paste0(c("(if executing a batch query).", cascade_message), collapse = "")
)
paste0(
"limit to the number of ", terms$input_plural, " in a batch geocoding query.",
"Defaults to the value in [batch_limit_reference] if not specified.",
collapse = " "
)
)
}

get_limit_documentation <- function(reverse, df_input) {
terms <- get_coord_address_terms(reverse)

main <- c(
paste0(c("maximum number of results to return per input ", terms$input_singular, ". For many geocoding services"), collapse = ""),
"the maximum value of the limit parameter is 100. Pass `limit = NULL` to use",
"the default `limit` value of the selected geocoding service.",
paste0(c("For batch geocoding, limit must be set to 1 (default) if `", terms$return_arg, " = TRUE`."), collapse = "")
)
main <-
paste0(c("maximum number of results to return per input ", terms$input_singular, ". For many geocoding services ",
"the maximum value of the limit parameter is 100. Pass `limit = NULL` to use ",
"the default `limit` value of the selected geocoding service. ",
"For batch geocoding, limit must be set to 1 (default) if `", terms$return_arg, " = TRUE`."),
collapse = "")

append <- if (df_input == FALSE) {
c()
""
} else {
paste0(c("To use `limit > 1` or `limit = NULL` set return_input to FALSE."), collapse = "")
"To use `limit > 1` or `limit = NULL` set return_input to FALSE."
}

return(c(main, append, "Refer to [api_parameter_reference] for more details."))
return(paste0(main, append, " Refer to [api_parameter_reference] for more details.", collapse = ""))
}

get_mode_documentation <- function(reverse) {
terms <- get_coord_address_terms(reverse)

return(
c(
paste0(c("set to 'batch' to force batch geocoding or 'single' to force single ", terms$input_singular), collapse = ""),
paste0(c("geocoding (one ", terms$input_singular, " per query). If not specified then batch geocoding will"), collapse = ""),
paste0(c("be used if available (given method selected) when multiple ", terms$input_plural, " are"), collapse = ""),
paste0(c(
"provided; otherwise single address geocoding will be used. For the ",
create_comma_list(pkg.globals$single_first_methods, wrap = '"'), " methods the"
), collapse = ""),
"batch mode should be explicitly specified with `mode = 'batch'`."
paste0(c(
"set to 'batch' to force batch geocoding or 'single' to force single ", terms$input_singular,
" geocoding (one ", terms$input_singular, " per query). If not specified then batch geocoding will ",
"be used if available (given method selected) when multiple ", terms$input_plural, " are ",
"provided; otherwise single address geocoding will be used. For the ",
create_comma_list(pkg.globals$single_first_methods, wrap = '"'), " methods the ",
"batch mode should be explicitly specified with `mode = 'batch'`."),
collapse = ""
)
)
}
Expand All @@ -201,9 +190,10 @@ get_full_results_documentation <- function(reverse) {
return_col_str <- if (reverse == TRUE) "a single address column is returned" else "latitude and longitude columns are returned"

return(
c(
"returns all available data from the geocoding service if TRUE. ",
paste0("If FALSE (default) then only ", return_col_str, " from the geocoding service.")
)
paste(c(
"returns all available data from the geocoding service if TRUE.",
"If FALSE (default) then only", return_col_str, "from the geocoding service."),
collapse = " "
)
)
}
Loading

0 comments on commit 430215b

Please sign in to comment.