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.
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.
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 } }
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" }, } }]
Need help? Contact PubNub Support.
Copyright (c) 2018 PubNub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Add demographic, spending, business, and lifestyle data to maps and apps
Learn more