munterfinger / hereR

Compare 9df7515 ... +0 ... 2050047

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -53,7 +53,7 @@
Loading
53 53
  # Check and preprocess location
54 54
  # Character location (remove pipes)
55 55
  if (is.character(poi)) {
56 -
    .check_addresses(poi)
56 +
    .check_character(poi)
57 57
    poi[poi == ""] <- NA
58 58
    url <- paste0(
59 59
      url,

@@ -36,7 +36,7 @@
Loading
36 36
geocode <- function(address, alternatives = FALSE, sf = TRUE, url_only = FALSE) {
37 37
38 38
  # Input checks
39 -
  .check_addresses(address)
39 +
  .check_character(address)
40 40
  .check_boolean(alternatives)
41 41
  .check_boolean(sf)
42 42
  .check_boolean(url_only)

@@ -47,7 +47,6 @@
Loading
47 47
## Requests
48 48
49 49
.async_request <- function(url, rps = Inf, ...) {
50 -
51 50
  .check_internet()
52 51
53 52
  # Check if rate limits are enabled

@@ -21,7 +21,7 @@
Loading
21 21
autosuggest <- function(address, results = 5, url_only = FALSE) {
22 22
23 23
  # Check addresses
24 -
  .check_addresses(address)
24 +
  .check_character(address)
25 25
  .check_numeric_range(results, 1, 100)
26 26
  .check_boolean(url_only)
27 27

@@ -17,6 +17,8 @@
Loading
17 17
#' @param routing_mode character, set the routing type: \code{"fast"} or \code{"short"} (\code{default = "fast"}).
18 18
#' @param transport_mode character, set the transport mode: \code{"car"}, \code{"truck"}, \code{"pedestrian"}, \code{"bicycle"} or \code{scooter} (\code{default = "car"}).
19 19
#' @param traffic boolean, use real-time traffic or prediction in routing (\code{default = TRUE})? If no traffic is selected, the \code{datetime} is set to \code{"any"} and the request is processed independently from time.
20 +
#' @param avoid_area, \code{sf} object, area (only bounding box is taken) to avoid in routes (\code{default = NULL}).
21 +
#' @param avoid_feature character, transport network features to avoid, e.g. \code{"tollRoad"} or \code{"ferry"} (\code{default = NULL}).
20 22
#' @param consumption_model character, specify the consumption model of the vehicle, see \href{https://developer.here.com/documentation/routing-api/8.16.0/dev_guide/topics/use-cases/consumption-model.html}{consumption model} for more information (\code{default = NULL} a average electric car is set).
21 23
#' @param url_only boolean, only return the generated URLs (\code{default = FALSE})?
22 24
#'
@@ -42,7 +44,8 @@
Loading
42 44
#' )
43 45
route <- function(origin, destination, datetime = Sys.time(), arrival = FALSE,
44 46
                  results = 1, routing_mode = "fast", transport_mode = "car",
45 -
                  traffic = TRUE, consumption_model = NULL, url_only = FALSE) {
47 +
                  traffic = TRUE, avoid_area = NULL, avoid_feature = NULL,
48 +
                  consumption_model = NULL, url_only = FALSE) {
46 49
47 50
  # Checks
48 51
  .check_points(origin)
@@ -54,6 +57,8 @@
Loading
54 57
  .check_routing_mode(routing_mode)
55 58
  .check_transport_mode(transport_mode, request = "route")
56 59
  .check_boolean(traffic)
60 +
  .check_polygon(avoid_area)
61 +
  .check_character(avoid_feature)
57 62
  .check_boolean(url_only)
58 63
59 64
  # Arrival time is not yet supported by the API
@@ -106,6 +111,27 @@
Loading
106 111
    results - 1
107 112
  )
108 113
114 +
  # Add avoidance of a bound box
115 +
  if (!is.null(avoid_area)) {
116 +
    url <- paste0(
117 +
      url,
118 +
      "&avoid[areas]=bbox:",
119 +
      paste(
120 +
        sf::st_bbox(sf::st_transform(avoid_area, 4326)),
121 +
        collapse = ","
122 +
      )
123 +
    )
124 +
  }
125 +
126 +
  # Add avoidance of features
127 +
  if (!is.null(avoid_feature)) {
128 +
    url <- paste0(
129 +
      url,
130 +
      "&avoid[features]=",
131 +
      paste(avoid_feature, collapse = ",")
132 +
    )
133 +
  }
134 +
109 135
  # Add consumption model if specified, otherwise set to default electric vehicle
110 136
  if (is.null(consumption_model)) {
111 137
    url <- paste0(

Click to load this diff.
Loading diff...

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R -0.59% 91.76%
Project Totals (16 files) 91.76%
Loading