External APIs

Esri: Directions

Create point-to-point routing, or build optimized routes that automatically consider traffic
Back to BLOCKS

About Esri: Directions

Esri, the global market leader in geographic information system (GIS) software, offers the most powerful mapping and spatial analytics technology available.

The Esri Routing Service for directions can be used to find the best way to get from one location to another or to visit several locations. The best route can be the quickest route for a given time of day taking traffic conditions into account, or it can be the shortest route that minimizes the travel distance.

Try it Now
Categories:
External APIs External APIs
Charting & Graphing
Charting & Graphing
Geolocation
Geolocation
Financial
Financial
Last Updated:
20170330 at 09:00:00
Author:
PubNub
Esri Directions

Walkthrough

The block requires four inputs: two pairs of latitude and longitude for each location. There are additional optional parameters you can specify such as travel modes (e.g., walk, drive or truck) or restrictions to avoid toll roads or height restrictions. From within the block, the Routing service is called and the response is sent back to the client. To learn more about Esri's Routing service visit the ArcGIS for Developer site or the ArcGIS REST API documentation. And, go here to sign-up for an ArcGIS Developer Program.

Input

Public message containing the starting and ending coordinates to the esri_routing_input channel.
{
    "start": {
        "lat": 37.783,
        "lon": -122.407
    },
    "end": {
        "lat": 37.782,
        "lon": -122.404
    }
}

Output

The block appends the Esri routing result into the message payload. Please refer to the Esri documentation for service properties.
"directions": [{
    "routeId": 1,
    "routeName": "Location 1 - Location 2",
    "summary": {
        "totalLength": 0.5016210795031204,
        "totalTime": 3.3444804616738111,
        "totalDriveTime": 3.3444804577208744
    },
    {
        "attributes": {
            "length": 0.097817482685470594,
            "time": 0.73990330796348514,
            "text": "Go southeast on 5th St toward Stevenson St",
            "ETA": -2209161600000,
            "arriveTimeUTC": -2209161600000,
            "maneuverType": "esriDMTStraight"
        },
    }
}]

Similar BLOCKS

Esri: Geocoding Icon Esri: Geocoding Convert addresses to location, and vice versa. Charting & Graphing BLOCKS Details Subcategory Geolocation BLOCKS Details Subcategory Financial BLOCKS Details Subcategory Esri: Geoenrichment Icon Esri: Geoenrichment Add demographic, spending, business, and lifestyle data to maps and apps. Charting & Graphing BLOCKS Details Subcategory Geolocation BLOCKS Details Subcategory Financial BLOCKS Details Subcategory