Skip to content

Commit

Permalink
Merge branch 'main' into feat/export_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aoles committed Oct 18, 2024
2 parents d4caf50 + 0378e2f commit 670ce9a
Show file tree
Hide file tree
Showing 30 changed files with 728 additions and 265 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
^\.Rproj\.user$
^man-roxygen$
^README\.Rmd$
^references.*$
^Makefile$
^pkgdown$
^docs$
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

env:
ORS_API_KEY: ${{ secrets.ORS_API_KEY }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
16 changes: 9 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
Package: openrouteservice
Title: Openrouteservice API Client
Version: 0.6.0
Authors@R: person("Andrzej", "Oleś", email = "[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.
Title: An 'openrouteservice' API Client
Version: 0.5.3
Authors@R: c(
person("Heidelberg Institute for Geoinformation Technology (HeiGIT) gGmbH", role = "cph"),
person(c("Andrzej", "K."), "Oleś", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0285-2787"))
)
Description: The client streamlines access to the services provided by <https://api.openrouteservice.org>.
It allows you to painlessly query for directions, isochrones, time-distance matrices, geocoding, elevation, points of interest, and more.
URL: https://github.com/GIScience/openrouteservice-r
BugReports: https://github.com/GIScience/openrouteservice-r/issues
Imports: geojsonsf, httr, jsonlite, jsonvalidate, keyring, leaflet, utils, V8, xml2
Suggests: covr, ggplot2, googlePolylines, lwgeom, knitr, mapview, pkgdown, RColorBrewer, rmarkdown, roxygen2, sf, testthat, units
License: Apache License 2.0 | file LICENSE
License: Apache License 2.0
Encoding: UTF-8
LazyData: true
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ RSCRIPT = Rscript --vanilla
%.md: %.Rmd
${RSCRIPT} -e 'rmarkdown::render("$<")'

README.md: vignettes/${PKGNAME}.Rmd NEWS.md
README.md: vignettes/${PKGNAME}.Rmd NEWS.md references.md

references.md: references.bib

readme: README.md

Expand Down
6 changes: 5 additions & 1 deletion R/api_call.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,10 @@ print.ors_api <- function(x, give.attr = FALSE, list.len = 6L, ...) {
invisible(x)
}

validator <- new.env()

#' @importFrom jsonvalidate json_validator
#' @importFrom V8 v8
validate_geojson <- NULL
validate_geojson <- function(...) {
validator$instance(...)
}
4 changes: 2 additions & 2 deletions R/directions.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' @template return-parsed
#' @template return-sf
#' @examples
#' coordinates <- list(c(8.34234, 48.23424), c(8.34423, 48.26424))
#' \donttest{coordinates <- list(c(8.34234, 48.23424), c(8.34423, 48.26424))
#'
#' # simple call
#' ors_directions(coordinates, preference="fastest")
Expand All @@ -27,7 +27,7 @@
#' # list of locations as `data.frame` output as simple features `sf` object
#' locations <- data.frame(lng = c(8.34234, 8.327807, 8.34423),
#' lat = c(48.23424, 48.239368, 48.26424))
#' ors_directions(locations, output = "sf")
#' ors_directions(locations, output = "sf")}
#' @template author
#' @export
ors_directions <- function(coordinates,
Expand Down
4 changes: 2 additions & 2 deletions R/elevation.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @template return-parsed
#' @template return-sf
#' @examples
#' # point coordinates
#' \donttest{# point coordinates
#' coordinates <- c(13.349762, 38.11295)
#' ors_elevation("point", coordinates)
#'
Expand All @@ -30,7 +30,7 @@
#' c(13.349762, 38.11295),
#' c(12.638397, 37.645772)
#' )
#' ors_elevation("polyline", coordinates, format_out = "encodedpolyline")
#' ors_elevation("polyline", coordinates, format_out = "encodedpolyline")}
#' @template author
#' @importFrom httr add_headers
#' @export
Expand Down
Loading

0 comments on commit 670ce9a

Please sign in to comment.