Select to view content in your preferred language

How can you set the stop time on RouteParameters?

2691
4
Jump to solution
10-27-2015 02:17 AM
SantoPfingsten
New Contributor II

I'm trying to use RouteTask with RouteParameters to calculate a route with stops. But I want to specify a time to wait at each stop.
The Plan Routes​ REST API seems to have a field stopServiceTime, but it seems to be missing in the Javascript API as well.

Is there any way to do this right now? Or is the RouteTask API not capable of this?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
GuillaumeBARRAS
New Contributor II

Hello,

In my previous reply, I assumed you want to consume Spatial Analyst Services from Esri and told you it was possible with out of the box digit or by sending REST request with "standard" HTTP Request (so without UI).

RouteTask/RouteParameters are objets design to help JavaScript developer to consume Network Analysis/Route Services (coming from Esri or from your own services/ArcGIS Server), not spatial analyst services.

With Route Service from Esri, you can specify the time that will be spent at each stop by adding the attribute Attr_TravelTime to each of your input stops (as describe in the REST API required parameters "stops").

Hope this helps

Regards

Hello,

In my previous reply, I assumed you want to consume Spatial Analyst Services from Esri and told you it was possible with out of the box digit or by sending REST request with "standard" HTTP Request (so without UI).

RouteTask/RouteParameters are design to help JavaScript developer to consume Network Analysis/Route Services (coming from Esri or from your own services/ArcGIS Server), not spatial analyst services.

With Route Service from Esri, you can specify the time that will be spent at each stop by adding the attribute Attr_TravelTime to each of your input stops (as describe in the REST API required parameters "stops").

Hope this helps

Regards

View solution in original post

4 Replies
GuillaumeBARRAS
New Contributor II

Hello,

If you plan to use Spatial Analyst service, it seems that you have a dedicated Widget in the ArcGIS API for JavaScript : Working with Analysis Widgets | Guide | ArcGIS API for JavaScript,

And it contains the PlanRoutes operation you mentioned. Be aware that this operation may consume some credits in your organization.

You may notice that the execute method doesn't take a RouteParameters in parameter but an object (array of parameters). You can find the list of parameters available in the Spatial Analyst Rest API documentation for the PlanRoutes Task .

Note that you can access a REST operation without specific API. You just need to be able to send HTTP Request (and of course known the parameters). This is detailed in the documentation here​​.

Regards.

SantoPfingsten
New Contributor II

Hello,

you failed to see my Problem. I don't have a Problem using the Javascript API instead of the REST API, I have the Problem, that the JS API does not seem to offer the parameters I need.
Besides, I'd much rather use RouteTask/RouteParameters instead of PlanRoutes and I want to use my own UI, not the one provided.

Regards.

0 Kudos
GuillaumeBARRAS
New Contributor II

Hello,

In my previous reply, I assumed you want to consume Spatial Analyst Services from Esri and told you it was possible with out of the box digit or by sending REST request with "standard" HTTP Request (so without UI).

RouteTask/RouteParameters are objets design to help JavaScript developer to consume Network Analysis/Route Services (coming from Esri or from your own services/ArcGIS Server), not spatial analyst services.

With Route Service from Esri, you can specify the time that will be spent at each stop by adding the attribute Attr_TravelTime to each of your input stops (as describe in the REST API required parameters "stops").

Hope this helps

Regards

Hello,

In my previous reply, I assumed you want to consume Spatial Analyst Services from Esri and told you it was possible with out of the box digit or by sending REST request with "standard" HTTP Request (so without UI).

RouteTask/RouteParameters are design to help JavaScript developer to consume Network Analysis/Route Services (coming from Esri or from your own services/ArcGIS Server), not spatial analyst services.

With Route Service from Esri, you can specify the time that will be spent at each stop by adding the attribute Attr_TravelTime to each of your input stops (as describe in the REST API required parameters "stops").

Hope this helps

Regards

SantoPfingsten
New Contributor II

Thats what I was looking for. Tho, We're not using the Esri service my co-worker just told me and the own service​ does not seem to support that attribute.
I guess I'll need to work arround it somehow.

Thanks for your help!

0 Kudos