Skip to content

Commit

Permalink
chore: remove deprecated functions and arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
rCarto committed May 27, 2024
1 parent 366b782 commit bec7b00
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 78 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

export(osrmIsochrone)
export(osrmIsodistance)
export(osrmIsometric)
export(osrmNearest)
export(osrmRoute)
export(osrmTable)
Expand Down
8 changes: 1 addition & 7 deletions R/osrmIsochrone.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#' @param res number of points used to compute isochrones, one side of the square
#' grid, the total number of points will be res*res. Increase res to obtain more
#' detailed isochrones.
#' @param returnclass deprecated.
#' @param smooth if TRUE a moving window with a gaussian blur is applied to
#' durations. This option may be usefull to remove small patches of hard to
#' reach areas. The computed isochrones are less precise but better looking.
Expand Down Expand Up @@ -70,16 +69,11 @@
#' }
osrmIsochrone <- function(loc, breaks = seq(from = 0, to = 60, length.out = 7),
exclude, res = 30, smooth = FALSE, k,
returnclass,
osrm.server = getOption("osrm.server"),
osrm.profile = getOption("osrm.profile")) {
opt <- options(error = NULL)
on.exit(options(opt), add = TRUE)

if (!missing(returnclass)) {
warning('"returnclass" is deprecated.', call. = FALSE)
}


# input management
loc <- input_route(x = loc, id = "loc", single = TRUE)
oprj <- loc$oprj
Expand Down
22 changes: 1 addition & 21 deletions R/osrmIsodistance.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#' @param res number of points used to compute isodistances, one side of the
#' square grid, the total number of points will be res*res. Increase res to
#' obtain more detailed isodistances.
#' @param returnclass deprecated.
#' @param smooth if TRUE a moving window with a gaussian blur is applied to
#' distances. This option may be usefull to remove small patches of hard to
#' reach areas. The computed isodistances are less precise but better looking.
Expand Down Expand Up @@ -68,16 +67,11 @@
#' }
osrmIsodistance <- function(loc, breaks = seq(from = 0, to = 10000, length.out = 4),
exclude, res = 30, smooth = FALSE, k,
returnclass,
osrm.server = getOption("osrm.server"),
osrm.profile = getOption("osrm.profile")) {
opt <- options(error = NULL)
on.exit(options(opt), add = TRUE)

if (!missing(returnclass)) {
warning('"returnclass" is deprecated.', call. = FALSE)
}

# input management
loc <- input_route(x = loc, id = "loc", single = TRUE)
oprj <- loc$oprj
Expand Down Expand Up @@ -221,18 +215,4 @@ osrmIsodistance <- function(loc, breaks = seq(from = 0, to = 10000, length.out =
}

return(iso)
}

#' @name osrmIsometric
#' @description deprecated, use \link{osrmIsodistance} instead.
#' @title deprecated
#' @param ... deprecated
#' @return deprecated
#' @keywords internal
#' @export
osrmIsometric <- function(...) {
warning("This function is deprecated, use osrmIsodistance() instead.",
call. = FALSE
)
osrmIsodistance(...)
}
}
6 changes: 0 additions & 6 deletions R/osrmRoute.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
#' @param exclude pass an optional "exclude" request option to the OSRM API.
#' @param osrm.server the base URL of the routing server.
#' @param osrm.profile the routing profile to use, e.g. "car", "bike" or "foot".
#' @param returnclass deprecated.

#' @return
#' The output of this function is an sf LINESTRING of the shortest route.\cr
#' It contains 4 fields: \itemize{
Expand Down Expand Up @@ -124,15 +122,11 @@ osrmRoute <- function(src,
loc,
overview = "simplified",
exclude,
returnclass,
osrm.server = getOption("osrm.server"),
osrm.profile = getOption("osrm.profile")) {
opt <- options(error = NULL)
on.exit(options(opt), add = TRUE)

if (!missing(returnclass)) {
warning('"returnclass" is deprecated.', call. = FALSE)
}
url <- base_url(osrm.server, osrm.profile, "route")

if (missing(loc)) {
Expand Down
7 changes: 1 addition & 6 deletions R/osrmTrip.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#' @param exclude pass an optional "exclude" request option to the OSRM API.
#' @param overview "full", "simplified". Add geometry either full (detailed) or simplified
#' according to highest zoom level it could be display on.
#' @param returnclass deprecated.
#' @param osrm.server the base URL of the routing server.
#' @param osrm.profile the routing profile to use, e.g. "car", "bike" or "foot".
#' @details As stated in the OSRM API, if input coordinates can not be joined by a single trip
Expand Down Expand Up @@ -55,15 +54,11 @@
#' )
#' }
osrmTrip <- function(loc, exclude = NULL, overview = "simplified",
returnclass, osrm.server = getOption("osrm.server"),
osrm.server = getOption("osrm.server"),
osrm.profile = getOption("osrm.profile")) {
opt <- options(error = NULL)
on.exit(options(opt), add = TRUE)

if (!missing(returnclass)) {
warning('"returnclass" is deprecated.', call. = FALSE)
}

url <- base_url(osrm.server, osrm.profile, "trip")

# input points
Expand Down
7 changes: 0 additions & 7 deletions inst/tinytest/test_osrmIsodistance.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ if(local_server){
osrm.server = "http://0.0.0.0:5000/",
osrm.profile = "driving"))

# old name
expect_warning(osrmIsometric(loc = c(13.43,52.47),
breaks = seq(0,14,2),
res = 10,
osrm.server = "http://0.0.0.0:5000/",
osrm.profile = "driving"))

# server error
expect_error(osrmIsodistance(loc = c(13.43,52.47), breaks = seq(0,500,100),
res = 10,
Expand Down
3 changes: 0 additions & 3 deletions man/osrmIsochrone.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/osrmIsodistance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions man/osrmIsometric.Rd

This file was deleted.

3 changes: 0 additions & 3 deletions man/osrmRoute.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/osrmTrip.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bec7b00

Please sign in to comment.