get_iso | R Documentation |
Calculates isochrones or isodistances in France from an sf object using the IGN API on the Géoportail platform. The reference data comes from the IGN BD TOPO® database. For further information see IGN documentation.
get_iso(x,
value,
type = "time",
profile = "pedestrian",
time_unit = "minute",
distance_unit = "meter",
direction = "departure",
source = "pgr",
constraints = NULL)
get_isodistance(x,
dist,
unit = "meter",
source = "pgr",
profile = "car",
direction = "departure",
constraints = NULL)
get_isochrone(x,
time,
unit = "minute",
source = "pgr",
profile = "car",
direction = "departure",
constraints = NULL)
x |
Object of class |
value |
|
type |
|
profile |
|
time_unit |
|
distance_unit |
|
direction |
|
source |
|
constraints |
Used to express constraints on the characteristics
to calculate isochrones/isodistances. See section |
dist |
|
unit |
see |
time |
|
object of class sf
with POLYGON
geometry
get_isodistance()
: Wrapper function to calculate isodistance from get_iso.
get_isochrone()
: Wrapper function to calculate isochrone from get_iso.
Isochrones are calculated using the same resources as for route calculation. PGR" and "VALHALLA" resources are used, namely "bdtopo-valhalla" and "bdtopo-pgr".
bdtopo-valhalla" : To-Do
bdtopo-iso" is based on the old services over a certain distance, to solve performance problems. We recommend its use for large isochrones.
PGR resources are resources that use the PGRouting engine to calculate isochrones. ISO resources are more generic. The engine used for calculations varies according to several parameters. At present, the parameter concerned is cost_value, i.e. the requested time or distance.
get_isodistance, get_isochrone
## Not run:
library(sf)
library(tmap)
# All area i can acces in less than 5 minute from penmarch centroid
penmarch <- get_apicarto_cadastre("29158")
penmarch_centroid <- st_centroid(penmarch)
isochrone <- get_isochrone(penmarch_centroid, 5)
qtm(penmarch, col = "red")+qtm(isochrone, col = "blue")+qtm(penmarch_centroid, fill = "red")
# All area i can acces as pedestrian in less than 1km
isodistance <- get_isodistance(penmarch_centroid, 1, unit = "kilometer", profile = "pedestrian")
qtm(penmarch, col = "red")+qtm(isodistance, col = "blue")+qtm(penmarch_centroid, fill = "red")
# In case of multiple point provided, the output will contain as many polygons as points.
code_insee <- c("29158", "29072", "29171")
communes_centroid <- get_apicarto_cadastre(code_insee) |> st_centroid()
isochrones <- get_isochrone(communes_centroid, 8)
isochrones$code_insee <- code_insee
qtm(isochrones, fill = "code_insee")
# Find area where i can acces all communes centroid in less than 8 minutes
area <- st_intersection(isochrones)
qtm(communes_centroid, fill = "red")+ qtm(area[area$origins == "1:3",])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.