Select to view content in your preferred language

Calculating Service Area using ArcGIS API Javascript

883
3
11-24-2020 04:48 AM
idhamid2
New Contributor

Hello All,

I am calculating the service area of facilities by using ArcGIS API Javascript in my application. I have 661 facilities but it only calculates the service area for 380 then gives the error of "Timeout". I am not understanding why it is happening?

Similarly, if I calculate the service area for 10 facilities, sometimes it calculates for 7, sometimes 9 or 10. Please help me what is the problem? I am using version 3.34 of ArcGIS API JS. 

And for Service Area I am using following link;

 
Regards,
Hamid Ali

 

0 Kudos
3 Replies
Marco_E_Cadario
Occasional Contributor

Hello,

Probably you have considered task duration, for synchronous execution mode is 5 minutes and for asynchronous execution mode is 2 hours.
If time execution exceed 5min or 2h you have a timeout. In this case you can check the appropriate http error code in the response.
Also you have to consider other limitations, for async see Usage Limits in https://developers.arcgis.com/rest/network/api-reference/service-area-asynchronous-service.htm#ESRI_...

 

Regards

Marco

0 Kudos
idhamid2
New Contributor

Hi @Marco_E_Cadario ,
Thank you for your reply. 

But it gives error before 5 minutes. I am not understanding what is the problem? If I calculate Service Area task for only 10 facilities, it also computes for 7 or 8 at everytime. 

I am using the sample server, due to thinking is that problem?

0 Kudos
Marco_E_Cadario
Occasional Contributor

Probably there are limitation on sample server.

Try to use https://route.arcgis.com/arcgis/rest/services/World/ServiceAreas/NAServer/ServiceArea_World/solveServiceArea?parameters

0 Kudos