43
ArcGIS Online: Developing Web Applications with Routing Services Deelesh Mandloi Dmitry Kudinov

ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

ArcGIS Online:

Developing Web Applications with

Routing ServicesDeelesh Mandloi

Dmitry Kudinov

Page 2: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Metadata

• Slides available at http://esriurl.com/ds17drs

• Documentation at http://developers.arcgis.com/features/directions

- First read the REST API doc and then read the doc for your SDK

Page 3: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Topics

• What routing services are available with ArcGIS Online?

• What can I do with the services?

• How to access the services?

- ArcGIS REST API

- ArcGIS API for JavaScript

• How much will the services cost me?

- To develop my application (Free fine print)

- To deploy my application

• Build an app using the services with Web App Builder

Page 4: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Route Closest Facility

Vehicle Routing

ProblemLocation-Allocation

Directions and Routing ServicesPerform analyses on street networks

Traffic

Service Area

Origin Destination

Cost Matrix

Page 5: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Common to all Services

View larger map

• Work globally

• Use high quality street data

- Predictive and real time traffic

where available

- Support for vehicle weight, width

and height restrictions

- Can use preferred truck routes or

avoid toll roads

• Driving, Walking, Trucking, or

your own travel modes

Page 6: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Execution modes

• Many services support synchronous as well as asynchronous

execution modes.

• Use synchronous mode for requests that execute quickly.

• Use asynchronous mode for long running requests (batch

processing).

- Submit a job and get a job id

- Check job status

- Get outputs

Page 7: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Common to all Services that Create Routes

• Routes can be saved as one or more Route Layers

• Route Layer includes all the information for one route such as stops

and travel directions

- Can be edited using the Directions widget

- Saved in the portal as an item

- Shared with other members of your organization

- Can be used by other apps such as Navigator for ArcGIS (in a future release)

Page 8: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Directions and Routing services

Page 9: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Directions

• Point-to-point routing – Simple Route

• Find the best route for visiting a series of stops that minimizes travel time or travel distance – Optimized route

• Use live traffic conditions

• Travel directions in many languages

• Synchronous and Asynchronous

execution

Page 10: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Directions

Request URL (Synchronous Execution)

https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/R

oute_World/solve?<parameters>

Example Request (Synchronous Execution)

https://route.arcgis.com/arcgis/rest/services/World/Route/NAServer/R

oute_World/solve?token=<yourToken>&stops=-122.4079,37.78356;-

122.404,37.782&f=pjson

Page 11: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Directions Service in ArcGIS API for JavaScript

• Easily add point to point routing with

driving directions to your applications

using the directions widget.

- Interactive route editing

- Add Line Barriers

- Save result as route layer

• Access Directions service in

synchronous execution mode using the

RouteTask class.

Page 12: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Directions Service in ArcGIS API for JavaScript

• Access Directions service in asynchronous

execution mode

- Using the Connect Origins to Destinations analysis

widget

- Geoprocessor class

Page 13: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Closest Facility

• Find the closest facilities from each incident

• Generate routes and driving directions

• You can also…

- Use live traffic conditions

- Limit the search distance

- Limit the number of facilities to find

- Travel from the facility to the incident

• Synchronous and Asynchronous execution

Page 14: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Closest Facility

Request URL (Synchronous Execution)

https://route.arcgis.com/arcgis/rest/services/World/ClosestFacility/

NAServer/ClosestFacility_World/solveClosestFacility?<parameters>

Example Request (Synchronous Execution)

https://route.arcgis.com/arcgis/rest/services/World/ClosestFacility/

NAServer/ClosestFacility_World/solveClosestFacility?token=<yourToken

>&incidents=-122.4496,37.7467&facilities= -122.4267,37.7486;-

122.4561,37.7513&f=pjson

Page 15: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Closest Facility Service in ArcGIS API for JavaScript

• Access Closest Facility service in

synchronous execution mode using the

ClosestFacilityTask class.

• Access Closest Facility service in

asynchronous execution mode

- Using the Find Nearest analysis widget

- Geoprocessor class

Page 16: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Service Areas

• Find the area you can reach from a

location in a given time period

• You can also…

- Solve for many locations

- Use multiple drive time values

- Analyze for different times of the day

- Specify the direction of travel

• Synchronous and Asynchronous

execution

Page 17: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Service Areas

Request URL (Synchronous Execution)

https://route.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAS

erver/ServiceArea_World/solveServiceArea?<parameters>

Example Request (Synchronous Execution)

https://route.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAS

erver/ServiceArea_World/solveServiceArea?token=<yourToken>&facilitie

s=-122.4496,37.7467&f=pjson

Page 18: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Service Areas Service in ArcGIS API for JavaScript

• Access Service Areas service in synchronous

execution mode using the ServiceAreaTask

class.

• Access Service Areas service in asynchronous

execution mode

- Using the Create Drive-Time Areas analysis widget

- Geoprocessor class

Page 19: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Vehicle Routing Problem

• Route a fleet of vehicles to

service a set of orders

• You can also specify…

- Vehicle capacities

- Driver specialties

- Work breaks

- Time windows on orders

• Synchronous and

Asynchronous execution

Page 20: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Vehicle Routing Problem

Request URLs (Asynchronous Execution)

Submit Job

https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRouti

ngProblem/GPServer/SolveVehicleRoutingProblem/submitJob?<parameters>

Get Job Status

https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRouti

ngProblem/GPServer/SolveVehicleRoutingProblem/jobs/<yourJobID>?token

=<yourToken>&f=json

Get Outputs

https://logistics.arcgis.com/arcgis/rest/services/World/VehicleRouti

ngProblem/GPServer/SolveVehicleRoutingProblem/jobs/<yourJobID>/resul

ts/<output_parameter_name>?token=<yourToken>&f=json

Page 21: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Vehicle Routing Problem Service in ArcGIS API for JavaScript

• Access Vehicle Routing Problem service in

synchronous execution mode using the

Geoprocessor class.

• Access Vehicle Routing Problem service in

asynchronous execution mode

- Using the Plan Routes analysis widget

- Geoprocessor class

Page 22: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Location Allocation

• Choose best facilities based on their

potential interaction with demand

points

• You can also…

- Choose from many different analysis types

- Limit the capacity of facilities

- Analyze for different times of the day

• Asynchronous execution only

Page 23: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Location Allocation

Request URLs (Asynchronous Execution)

Submit Job

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAll

ocation/GPServer/SolveLocationAllocation/submitJob?<parameters>

Get Job Status

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAll

ocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>?token=<yo

urToken>&f=json

Get Outputs

https://logistics.arcgis.com/arcgis/rest/services/World/LocationAll

ocation/GPServer/SolveLocationAllocation/jobs/<yourJobID>/results/<

output_parameter_name>?token=<yourToken>&f=json

Page 24: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Location Allocation Service in ArcGIS API for

JavaScript

• Access Location Allocation

service in asynchronous

execution mode

- Using the Choose Best Facilities

analysis widget

- Using the Geoprocessor class.

Page 25: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Origin Destination Cost Matrix (Beta)

• Generates a table containing travel

times and travel distances between

all origins and all destinations.

• You can also…

- Specify a cutoff

- Limit the number of destinations to find

- Analyze for different times of the day

• Asynchronous execution only

Page 26: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Origin Destination Cost Matrix

Request URLs (Asynchronous Execution)

Submit Job

https://logistics.arcgis.com/arcgis/rest/services/World/OriginDestin

ationCostMatrix/GPServer/GenerateOriginDestinationCostMatrix/submitJ

ob?<parameters>

Get Job Status

https://logistics.arcgis.com/arcgis/rest/services/World/

OriginDestinationCostMatrix/GPServer/Generate

OriginDestinationCostMatrix

/jobs/<yourJobID>?token=<yourToken>&f=json

Get Outputs

https://logistics.arcgis.com/arcgis/rest/services/World/

OriginDestinationCostMatrix/GPServer/Generate

OriginDestinationCostMatrix

/jobs/<yourJobID>/results/<output_parameter_name>?token=<yourToken>&

f=json

Page 27: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Origin Destination Cost Matrix Service in ArcGIS API for

JavaScript

• Access Origin Destination Cost Matrix service

in asynchronous execution mode

- Geoprocessor class

Page 28: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Utilities

• Provides auxiliary information for working with

the services

• Get a list of travel modes supported by all the

services

• Get execution limits for the services

• Synchronous execution only

Page 29: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Utilities

Request URL (Synchronous Execution)

https://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GP

Server/GetTravelModes/execute?<parameters>

Example Request (Synchronous Execution)

https://logistics.arcgis.com/arcgis/rest/services/World/Utilities/GP

Server/GetTravelModes/execute?token=<yourToken>&f=pjson

Page 30: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Utilities Service in ArcGIS API for JavaScript

• Access Utilities service in synchronous

execution mode

- Geoprocessor class

Page 31: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Traffic

• Visualize traffic speeds

- Support for live, historical and

predictive traffic conditions

• Traffic Incidents

• Background layer to display

results from routing services

• Data updated every five minutes

• Synchronous execution only

Page 32: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Traffic

Request URL https://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapSer

ver/export?<parameters>

Example Request http://traffic.arcgis.com/arcgis/rest/services/World/Traffic/MapServ

er/export?token=<yourToken>&bbox=-

13168112.16706758,4029125.2769380505,-

13152117.71889893,4037275.375078947&f=image

Page 33: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Traffic Service in ArcGIS API for JavaScript

• Access Traffic service

- Using the Traffic Web Map

- Using the ArcGISDynamicMapServiceLayer

class

Page 34: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Accessing services

Page 35: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Accessing Routing Services

• All services are secured and require ArcGIS

Online organization subscription with service

credits

• Every request to a secured service requires a

valid token

Page 36: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

ArcGIS Online Subscription

• Required to access routing services

• Sign up for a 60 day free trial with 200 service credits

• Sign up for a free Essential plan in the ArcGIS Developer Program

(provides 50 service credits every month)

Page 37: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Authentication using OAuth2 – User Logins

• Your app asks the end users to

login.

• Use the identity manager

provided by your SDK.

• Authentication documentation

Page 38: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Authentication using OAuth2 – App Logins

• Your app logs in behind the scenes

• Register your app and get a client

id and client secret

• Manage your client id and client

secret using a service proxy

• ArcGIS Online hosted proxy service

• A self hosted resource proxy

• Authentication documentation

Page 39: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Understanding Your Bill – Service Credits

• Every successful request to

secured services deducts

credits

- Use of traffic and Utilities services

does not deduct credits

- Use of Origin Destination Cost

Matrix service does not deduct

credits while in beta

• Track credits used by your app

• Credits Explained

Page 40: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

• Custom web app built using

Web App Builder

• Use a custom widget that

glues together the Plan

Routes and Directions

widgets.

Demo:

Pizza Load Balancer

Page 41: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Please take our SurveyYour feedback allows us to help maintain high standards and to help presenters

Find the session you want to review

Find your event in the Esri Events App

Scroll down to the bottom of the session

Answer survey questions and submit

Page 42: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets

Questions?

http://esriurl.com/ds17drsSlides and code samples from this demo theater:

Page 43: ArcGIS Online: Developing Web Applications with …...• Custom web app built using Web App Builder • Use a custom widget that glues together the Plan Routes and Directions widgets