Select to view content in your preferred language

Can I use an ArcGIS Online Feature Layer as the facility url for the AGOL ClosestFacility task?

3519
1
Jump to solution
10-16-2014 02:54 PM
JonSwoveland1
Emerging Contributor

Hi All,

I am attempting to use the ArcGIS Online Closest Facility task:

http://route.arcgis.com/arcgis/rest/services/World/ClosestFacility/NAServer/ClosestFacility_World/so...

With the following parameters for facilities and incidents:

facilities{"url":"http://services.arcgis.com/RmCCgQtiZLDCtblq/arcgis/rest/services/Fire_Stations/FeatureServer/0/query...","doNotLocateOnRestrictedElements":"false"}
incidents{"features":[{"geometry":{"x":-13172928.229559887,"y":4038931.0269312863,"spatialReference":{"wkid":102100}}}]}

Obviously the token in the above facilities url is now expired, however at the time of execution, I can copy the full url into a browser and I get back a feature set with 65 features.

Unfortunately when I execute the ClosestFacility task, I get the response:

         0 location(s) in "Facilities" are valid.  Need at least 1 valid location(s).  Insufficient number of valid locations in "Facilities" or "Incidents".

Has anybody successfully used the url to an ArcGIS Online Feature Layer as the source of the facilities parameter?

Does anybody know why this might be failing?

Thanks,

Jon Swoveland

0 Kudos
1 Solution

Accepted Solutions
JonSwoveland1
Emerging Contributor

Nevermind, I figured it out.

I was escaping the '=' characters in the query string.  Fiddler was un-escaping these, so when I copied the url it worked.

View solution in original post

0 Kudos
1 Reply
JonSwoveland1
Emerging Contributor

Nevermind, I figured it out.

I was escaping the '=' characters in the query string.  Fiddler was un-escaping these, so when I copied the url it worked.

0 Kudos