ArcGIS Online - Using Spatial Analysis Service From JS API

438
2
12-09-2013 05:22 PM
ShaunWeston
Occasional Contributor
I'm trying to use one of the spatial analysis services from a javascript app I've built, but having some issues. I'd like to use this service:

https://developers.arcgis.com/en/rest/analysis/api-reference/find-hot-spots.htm

A
nd have a ArcGIS Online developer account. I basically have some code to request a token and send it with a featureset to this service and this is the reponse I get back from the service:

  1. inputs: {}
  2. jobId: "j8c0cb0dbe6814e5b9ec3b29e8885da8f"
  3. jobStatus: "esriJobFailed"
  4. messages: [{type:esriJobMessageTypeError,�?�},�?�]
    1. 0: {type:esriJobMessageTypeError,�?�}
      1. description: "{"messageCode": "AO_100007", "message": "FindHotSpots failed."}"
      2. type: "esriJobMessageTypeError"
    2. 1: {type:esriJobMessageTypeError, description:Failed to execute (FindHotSpots).}
      1. description: "Failed to execute (FindHotSpots)."
      2. type: "esriJobMessageTypeError"
      3. 2: {type:esriJobMessageTypeError, description:Failed.}
        1. description: "Failed."
        2. type: "esriJobMessageTypeError"
        3. results: {}



        4. it's pretty vague, so I don't where it's going wrong, whether my inputs are wrong or what?

          Anyone know?
          0 Kudos
          2 Replies
          ShaunWeston
          Occasional Contributor
          Ok, so now I'm getting a different error:

          ERROR 000735: analysisLayer: Value is required


          Also, with this sample:

          http://developers.arcgis.com/en/javascript/samples/analysis_hotspot/


          I
          've tried with a couple of accounts (a developer account and an ArcGIS for organisations account) and it didn't work, then I tried with another account (another ArcGIS for organisations account) and it did work, so pretty confused how to use these services.
          0 Kudos
          ShaunWeston
          Occasional Contributor
          Ok managed to get this to work. It was a combination of things that was causing it to not work correctly.

          I've managed to create a feature collection, load in the features to be analysed to this feature collection and send it to the service. Then I get a feature collection back and can add that to the map, so had to write a bit of code to get that to work.
          0 Kudos