ors_pois | R Documentation |
Search for points of interest around points or in geometries.
ors_pois(
request = c("pois", "stats", "list"),
geometry,
...,
api_key = ors_api_key(),
output = c("parsed", "text", "sf")
)
request |
One of the following: |
geometry |
named list containing either a |
... |
Optional request attributes as described here |
api_key |
Character scalar containing openrouteservice API key |
output |
Output format. By default the response is being parsed to a list-based R object |
There are three different request types: pois
, stats
and list
.
pois
returns a GeoJSON FeatureCollection in the bounding box specified in
geometry$bbox
or a GeoJSON geometry provided in geometry$geojson
. stats
does the same but groups by categories, ultimately returning a JSON object
with the absolute numbers of POIs of a certain group.
list
returns a list of category groups and their ids.
A list of points of interest in the area specified in geometry
structured according to output
:
for "text"
, a character vector of length 1 re-encoded to UTF-8.
for "parsed"
, a parsed R object.
for "sf"
, a simple features sf
object. Valid only for argument request = "pois"
.
Andrzej Oleś andrzej.oles@gmail.com
# POI categories list
ors_pois('list')
# POIs around a buffered point
geometry <- list(geojson = list(type = "Point",
coordinates = c(8.8034, 53.0756)),
buffer = 100)
ors_pois(geometry = geometry)
# alternative specification via bounding box
ors_pois(geometry = list(bbox = list(c(8.8034, 53.0756), c(8.8034, 53.0756)),
buffer = 100))
# POIs of given categories
ors_pois(geometry = geometry,
limit = 200,
sortby = "distance",
filters = list(
category_ids = c(180, 245)
))
# POIs of given category groups
ors_pois(geometry = geometry,
limit = 200,
sortby = "distance",
filters = list(
category_group_ids = 160
))
# POI Statistics
ors_pois("stats", geometry = geometry)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.