Learn R Programming

⚠️There's a newer version (1.1.0) of this package.Take me there.

hereR

The hereR package provides an interface to the HERE REST APIs for R: (1) geocode and autocomplete addresses or reverse geocode POIs using the Geocoder API; (2) route directions, travel distance or time matrices and isolines using the 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) 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

Install the released version from CRAN with:

install.packages("hereR")

Install the development version from GitHub with:

devtools::install_github("munterfinger/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 free login and project 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, please use:

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

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 following examples. A more detailed description can be found in the documentation of the functions and the package vignettes.

Geocoder API: Autocomplete and geocode addresses or reverse geocode POIs.

geocode(c("Schweighofstrasse 190, Zürich, Schweiz", "Hardstrasse 48, Zürich, Schweiz"))

autocomplete(c("Schweighofstrasse", "Hardstrasse"))

reverse_geocode(poi)

Routing API: Construct a route, create a route matrix or request an isochrone around points.

route(poi[1:2, ], poi[3:4, ], mode = "car")

route_matrix(poi, mode = "car")

isoline(poi, rangetype = "time", mode = "car")

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

flow(aoi[2, ])

incident(aoi, from = as.POSIXct("2018-01-01 00:00:00"))

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

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

station(poi, radius = 500)

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")

References

Copy Link

Version

Install

install.packages('hereR')

Monthly Downloads

654

Version

0.3.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Merlin Unterfinger

Last Published

March 29th, 2020

Functions in hereR (0.3.2)

hereR-package

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

HERE Routing API: Calculate Isoline
incident

HERE Traffic API: Incidents
connection

HERE Public Transit API: Transit Route
flow

HERE Traffic API: Flow
geocode

HERE Geocoder API: Geocode
hereR-deprecated

Deprecated functions in package hereR.
hereR-defunct

Defunct functions in package hereR.
aoi

Example Areas of Interest
set_auth-defunct

Defunct: Set Application Credentials
route

HERE Routing API: Calculate Route
set_key

Set HERE Application Credentials
route_matrix

HERE Routing API: Calculate Matrix
station

HERE Public Transit API: Find Stations Nearby
poi

Example Points of Interest
autocomplete

HERE Geocoder API: Autocomplete
set_proxy

Proxy Configuration
traffic-defunct

HERE Traffic API: Flow and Incidents
unset_key

Remove HERE Application Credentials
reverse_geocode

HERE Geocoder API: Reverse Geocode
unset_proxy

Remove Proxy Configuration
weather

HERE Destination Weather API: Observations, Forecasts, Astronomy and Alerts
unset_auth-defunct

Remove Application Credentials