-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: openrouteservice | ||
Title: Openrouteservice API Client | ||
Version: 0.4.2 | ||
Authors@R: person("Andrzej", "Oleś", email = "andrzej@openrouteservice.org", comment = c(ORCID = "0000-0003-0285-2787"), role = c("aut", "cre")) | ||
Version: 0.5.0 | ||
Authors@R: person("Andrzej", "Oleś", email = "andrzej[email protected]", comment = c(ORCID = "0000-0003-0285-2787"), role = c("aut", "cre")) | ||
Description: The package streamlines access to the services provided by openrouteservice.org. | ||
It allows you to painlessly query for directions, geocoding, isochrones, time-distance matrices, and POIs. | ||
URL: https://github.com/GIScience/openrouteservice-r | ||
|
@@ -13,4 +13,4 @@ Encoding: UTF-8 | |
LazyData: true | ||
VignetteBuilder: knitr | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.2.3 | ||
RoxygenNote: 7.3.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# openrouteservice 0.5.0 | ||
|
||
## NEW FEATURES | ||
|
||
- Enable snap endpoint. | ||
|
||
# openrouteservice 0.4.0 | ||
|
||
## NEW FEATURES | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#' Openrouteservice Snapping | ||
#' | ||
#' Snap coordinates to road network | ||
#' | ||
#' @template param-coordinates | ||
#' @templateVar argname locations | ||
#' @template param-profile | ||
#' @param radius Maximum radius in meters around given coordinates to search for graph edges | ||
#' @param format Response format, defaults to `"geojson"` | ||
#' @template param-common | ||
#' @templateVar dotsargs parameters | ||
#' @templateVar endpoint snap | ||
#' @template return | ||
#' @templateVar return Coordinates of snapped location(s) and distance to the original point(s) | ||
#' @template return-text | ||
#' @template return-parsed | ||
#' @examples | ||
#' locations = list( | ||
#' c(8.669629, 49.413025), | ||
#' c(8.675841, 49.418532), | ||
#' c(8.665144, 49.415594) | ||
#' ) | ||
#' | ||
#' # query for duration and distance in km | ||
#' res = ors_snap(locations, radius = 350) | ||
#' | ||
#' @template author | ||
#' @export | ||
ors_snap <- function(locations, | ||
profile = ors_profile(), | ||
radius, | ||
format = c('geojson', 'json'), | ||
..., | ||
api_key = ors_api_key(), | ||
output = c("parsed", "text")) { | ||
## required arguments with no default value | ||
if (missing(locations)) | ||
stop('Missing argument "locations"') | ||
if (missing(radius)) | ||
stop('Missing argument "radius"') | ||
|
||
## required arguments with defaults | ||
profile <- match.arg(profile) | ||
format <- match.arg(format) | ||
output <- match.arg(output) | ||
|
||
names(locations) <- NULL | ||
|
||
## request parameters | ||
body <- list(locations = locations, radius = radius, ...) | ||
|
||
api_call( | ||
path = c("v2/snap", profile, format), | ||
api_key = api_key, | ||
body = body, | ||
encode = "json", | ||
output = output | ||
) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
#' @author Andrzej Oleś <andrzej@@openrouteservice.org> | ||
#' @author Andrzej Oleś <andrzej.oles@@gmail.com> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.