MyNixOS website logo
Description

'sf'-Based Interface to the 'HERE' REST APIs.

Interface to the 'HERE' REST APIs <https://developer.here.com/develop/rest-apis>: (1) geocode and autosuggest addresses or reverse geocode POIs using the 'Geocoder' API; (2) route directions, travel distance or time matrices and isolines using the 'Routing', 'Matrix Routing' and 'Isoline Routing' APIs; (3) request real-time traffic flow and incident information from the 'Traffic' API; (4) find request public transport connections and nearby stations from the 'Public Transit' API; (5) request intermodal routes using the 'Intermodal Routing' API; (6) get weather forecasts, reports on current weather conditions, astronomical information and alerts at a specific location from the 'Destination Weather' API. Locations, routes and isolines are returned as 'sf' objects.

hereR

CRAN status CRAN checks CRAN downloads R-CMD-check Codecov test coverage CodeFactor

The hereR package provides an interface to the HERE REST APIs for R: (1) geocode and autosuggest addresses or reverse geocode POIs using the Geocoder API; (2) route directions, travel distance or time matrices and isolines using the Routing API, Matrix Routing API and Isoline Routing API; (3) request real-time traffic flow and incident information from the Traffic API; (4) find public transport connections and nearby stations using the Public Transit API; (5) request intermodal routes using the Intermodal Routing API; (6) get weather forecasts, reports on current weather conditions and astronomical information at a specific location from the Destination Weather API.

Locations, routes and isolines are returned as sf objects.

Installation

You can install the released version of hereR from CRAN with:

install.packages("hereR")

Install the development version from GitHub with:

remotes::install_github("munterfi/hereR")

Usage

This package requires an API key for a HERE project. The key is set for the current R session and is used to authenticate in the requests to the APIs. A login can be created on developer.here.com. In order to obtain the API key navigate to a project of your choice in the developer portal, select 'REST: Generate APP' and then 'Create API Key'.

To set the API key, use:

library(hereR)
set_key("<YOUR API KEY>")

Note: Your use of the HERE APIs with this package is subject to the HERE Developer Terms and Conditions. For freemium licenses the number of requests per second (RPS) is limited, use set_freemium(FALSE) to turn off limits for accounts with paid plans.

Once valid application credentials are created and the key is set in the R session, the APIs can be addressed using the functions shown in the examples below. A more detailed description can be found in the documentation of the functions and the package vignettes.

Geocoding & Search API: Autosuggest and geocode addresses or reverse geocode POIs.

geocode(c("Schweighofstrasse 190, Zurich, Switzerland", "Hardstrasse 48, Zurich, Switzerland"))

autosuggest(c("Schweighofstrasse", "Hardstrasse"))

reverse_geocode(poi)

Routing API: Construct route geometries with elevation (dim = XYZ).

route(poi[1:2, ], poi[3:4, ], transport_mode = "car", traffic = TRUE)

route(poi[1:2, ], poi[3:4, ], transport_mode = "car", traffic = FALSE)

route(poi[4, ], poi[5, ], transport_mode = "bicycle")

Matrix Routing API: Request a matrix of route summaries.

route_matrix(poi, transport_mode = "car", traffic = TRUE)

route_matrix(
  geocode(c("Schweighofstrasse 190, Zurich, Switzerland", "Hardstrasse 48, Zurich, Switzerland")),
  transport_mode = "bicycle", traffic = FALSE
)

Isoline Routing API: Construct isolines around points (time, distance or consumption).

isoline(poi, range_type = "time", transport_mode = "pedestrian")

isoline(poi, range_type = "distance", transport_mode = "truck")

isoline(poi, range_type = "consumption", transport_mode = "car", traffic = FALSE)

Traffic API: Get real-time traffic flow or incidents in a specific area.

flow(aoi)

incident(aoi)

Public Transit API: Request public transport connections between points or find stations nearby.

connection(poi[1:2, ], poi[3:4, ])

station(poi, radius = 500)

Intermodal Routing API: Get routes with various combinations of transport modes.

intermodal_route(poi[1:2, ], poi[3:4, ])

Destination Weather API: Request weather observations, forecasts, astronomical information or alerts at specific locations.

weather(poi, product = "observation")

weather(poi, product = "forecast_hourly")

weather(poi, product = "forecast_astronomy")

weather(poi, product = "alerts")

Contributing

  • Contributions to this package are very welcome, issues and pull requests are the preferred ways to share them. Please see the Contribution Guidelines.
  • This project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

References

Metadata

Version

1.0.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows