Description Usage Arguments Details Value References Examples
View source: R/traveltime_map.R
get_traveltime
is the main function of the traveltimeR package. It retrieves traveltime-isochrones from the traveltime platform, which supports several modes of transport in several countries and brings them into r as polygons stored in sf-objects.
1 2 3 |
appId |
Traveltime-Plattform Application ID |
apiKey |
Traveltime-Plattform API-Key |
location |
vector of lat / long coordinates, coordinate system WGS84 / espg 4326, example: c(47.233,8.234). |
traveltime |
traveltime in seconds |
type |
transportation mode |
departure |
time of departure, date in extended ISO-8601 format (incl. timezone), example: "2018-08-05T08:00:00Z" |
arrival |
time of arrival, date in extended ISO-8601 format (incl. timezone), example: "2018-08-05T08:00:00Z" |
get_traveltime - retrieve isochrones for traveltimemaps from Traveltime API
To call the API via the package you need to get an api-key here http://docs.traveltimeplatform.com/overview/getting-keys/. If you're not using the API for commercial use users can get 10,000 free API queries a month. The following transport modes are supported (type):"cycling"", "cycling_ferry", "driving", "driving+train", "driving_ferry", "public_transport", "walking", "walking+coach", "walking_bus", "walking_ferry" or "walking_train".
the results from the search
1 2 3 4 5 6 7 8 9 10 |
traveltime30 <- traveltime_map(appId="yourAppID",
apiKey="yourApiKey",
location=c(47.378610,8.54000),
traveltime=1800,
type="public_transport",
departure="2018-10-05T08:00:00+01:00")
#plot the isochrones
plot(traveltime30)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.