Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove consumption model in route requests for bicycle #171

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# version 1.0.1

- Prevent the consumption model from being added to the request when the transport mode is set to `"pedestrian"` in `isoline()` and `route()` functions (closes [#167](https://github.com/munterfi/hereR/issues/167)).
- Adjust the rate limit in `route()` to 7 requests per second (RPS). Although HERE's documentation specifies a 10 RPS limit, it has been lowered to 7 RPS to avoid frequent 429 "Too Many Requests" errors.
- Adjust the rate limit in `route()` to 7 requests per second (RPS). Although HERE's documentation specifies a 10 RPS limit, it has been lowered to 5 RPS to avoid frequent 429 "Too Many Requests" errors.

# version 1.0.0

Expand Down
4 changes: 2 additions & 2 deletions R/route.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ route <- function(origin, destination, datetime = Sys.time(), arrival = FALSE,
)
}

if (transport_mode != "pedestrian") {
if (!(transport_mode %in% c("pedestrian", "bicycle"))) {
# Add consumption model if specified, otherwise set to default electric vehicle
if (is.null(consumption_model)) {
url <- paste0(
Expand Down Expand Up @@ -179,7 +179,7 @@ route <- function(origin, destination, datetime = Sys.time(), arrival = FALSE,
# Request and get content
data <- .async_request(
url = url,
rps = 7
rps = 5
)
if (length(data) == 0) {
return(NULL)
Expand Down
Loading