ArcGIS Blog

Developers

R-ArcGIS Bridge

Welcome {arcgisrouting} to the R-ArcGIS Bridge 👋

By Josiah Parry and Nicholas Giner and Martha Bass

The Routing and directions location service is now available in the R-ArcGIS Bridge via the {arcgisrouting} package!

Routing and directions is one of a handful of Mapping and location services.
With this, the R-ArcGIS Bridge is baby stepping its way to full support of all services Esri provides.

With this, only Mapping, Data visualization, Data Enrichment, and Elevation, are left!

 

Routing and Directions from R

The Routing and directions location service enables developers to plan routes, create directions, and perform “advanced analyses” on street networks. {arcgisrouting} makes it possible to:
The package has full coverage of all endpoints provided by the service supporting small direct requests, as well as asynchronous and large ones.

Worked example

We can use the {arcgisrouting} package to calculate driving time from downtown Seattle in increments of 5, 10, and 15 minutes.
A screenshot of R code and output which is directly below. library(sf) library(arcgisutils) library(arcgisrouting) set_arc_token(auth_user()) facility Simple feature collection with 3 features and 7 fields #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: -122.3874 ymin: 47.48932 xmax: -122.1501 ymax: 47.75189 #> Geodetic CRS: WGS 84 #> # A data frame: 3 × 8 #> ObjectID FacilityID Name FromBreak ToBreak Shape_Length Shape_Area #> * #> 1 1 1 Location 1 : 10 - 15 10 15 3.07 0.00968 #> 2 2 1 Location 1 : 5 - 10 5 10 0.846 0.00278 #> 3 3 1 Location 1 : 0 - 5 0 5 0.107 0.000403 #> # ℹ 1 more variable: geometry
Using {arcgisrouting} to create an isochrone.

And as a special preview of what we are working on, we can visualize the result in a webmap using the currently-in-development package {arcgisviz}.

An image of the code which is below: # ✨ in development! # pak::pak("r-arcgis/arcgisviz") library(arcgisviz) arc_map("gray-vector") |> add_layer(isochrone, color = Name, opacity = 0.5)
Visualizing the isochrone using {arcgisviz}.
A map of the isochrones that we created.
The generated isochrones visualized using the development package, {arcgisviz}.

Share this article

Leave a Reply

Related articles