Skip to content

Commit

Permalink
Update function references in vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
munterfi committed Nov 13, 2019
1 parent 00a80f6 commit 6ee9bf9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions vignettes/routing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ iso <- hereR:::example$isoline
Routing directions between locations, travel distance or time origin-destination matrices and isolines for points of interest (POIs) based on the 'HERE Routing' API.

## Routing directions
In order to calculate route geometries (`LINESTRING`) between pairs of points using the 'HERE Routing API' the function `route` is used. The function takes start and destination locations as `sf` objects containing geometries of type `POINT` as input. Routes can be created for various transport modes, as for example car or public transport. Optionally the current or predicted traffic information is considered. For routes using the transport mode `"car"` a vehicle type can be specified, to obtain an estimate of the energy consumption on the routes.
In order to calculate route geometries (`LINESTRING`) between pairs of points using the 'HERE Routing API' the function `route()` is used. The function takes start and destination locations as `sf` objects containing geometries of type `POINT` as input. Routes can be created for various transport modes, as for example car or public transport. Optionally the current or predicted traffic information is considered. For routes using the transport mode `"car"` a vehicle type can be specified, to obtain an estimate of the energy consumption on the routes.
```{r directions, eval=FALSE}
routes <- route(
start = poi[1:2, ],
Expand All @@ -48,7 +48,7 @@ mapview(routes,
```

## Routing matrix
The function `route_matrix` calculates a matrix of route summaries between given POIs. The function takes start and destination locations as `sf` objects containing geometries of type `POINT` as input. If only one `sf` object is provided as `start` an origin-destination matrix, which covers all route combinations, is constructed. Various transport modes and current or predicted traffic information are supported. The requested matrix is split into (sub-)matrices of dimension 15x100 in order to use the maximum allowed matrix size per request. Thereby the number of overall needed requests is minimized. The return value of the function `route_matrix` is one route summary matrix, that fits the order of the provided POIs: startIndex, destinationIndex.
The function `route_matrix()` calculates a matrix of route summaries between given POIs. The function takes start and destination locations as `sf` objects containing geometries of type `POINT` as input. If only one `sf` object is provided as `start` an origin-destination matrix, which covers all route combinations, is constructed. Various transport modes and current or predicted traffic information are supported. The requested matrix is split into (sub-)matrices of dimension 15x100 in order to use the maximum allowed matrix size per request. Thereby the number of overall needed requests is minimized. The return value of the function `route_matrix` is one route summary matrix, that fits the order of the provided POIs: startIndex, destinationIndex.
```{r matrix, eval=FALSE}
# From - to
mat <- route_matrix(
Expand All @@ -69,7 +69,7 @@ knitr::kable(head(mat, 10), format = "html")
```

## Isoline
Isolines are constructed by the function `isoline`. The calculated polygons (`POLYGON` or `MULTIPOLYGON`) connect the end points of all routes leaving from defined centers (POIs) with either a specified length (isodistance), a specified travel time (isochrone) or consumption (isoconsumption), whereby time is measured in seconds, distance in meters and consumption as costfactor. By default the `aggregate` parameter is set to `TRUE`, which means that the isoline polygons are intersected and the minimum range value (time, distance or consumption) is taken in all intersecting areas, then the polyons are aggregated to polygons of geometry type `MULTIPOLYGON`. Thereby overlapping isolines are avoided.
Isolines are constructed by the function `isoline()`. The calculated polygons (`POLYGON` or `MULTIPOLYGON`) connect the end points of all routes leaving from defined centers (POIs) with either a specified length (isodistance), a specified travel time (isochrone) or consumption (isoconsumption), whereby time is measured in seconds, distance in meters and consumption as costfactor. By default the `aggregate` parameter is set to `TRUE`, which means that the isoline polygons are intersected and the minimum range value (time, distance or consumption) is taken in all intersecting areas, then the polyons are aggregated to polygons of geometry type `MULTIPOLYGON`. Thereby overlapping isolines are avoided.
```{r isoline, eval=FALSE}
iso <- isoline(
poi,
Expand Down
2 changes: 1 addition & 1 deletion vignettes/weather.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Weather forecasts, reports on current weather conditions, astronomical informati

## Observations
In order to request information about the current weather situation points of interest (POIs) have to be provided. The POIs must be an `sf` object containing geometries of type `POINT` or a `character` vector containing place names (e.g. cities).
These POIs are passed to the `weather` function, whereby the `product` parameter is set to `"observation"`:
These POIs are passed to the `weather()` function, whereby the `product` parameter is set to `"observation"`:
```{r observations, eval = FALSE}
observation <- weather(
poi = poi,
Expand Down

0 comments on commit 6ee9bf9

Please sign in to comment.