Export GP tool app

1274
9
Jump to solution
06-26-2014 09:00 AM
jaykapalczynski
Frequent Contributor
Trying to get the Extract Example to work on my Map Service and GP service.  I dont know why its not working but I am getting the error "esriJobFailed"
Example: https://developers.arcgis.com/javascript/jssamples/gp_clipasync.html

My app is here with all the code available in the Source: https://fwisweb1.dgif.virginia.gov/dgifmapping/DataExtract.html

GP Service: https://fwisweb1.dgif.virginia.gov/arcgis/rest/services/Public/ExtractDataTask/GPServer/Clip_n_Zip

Map Service: https://fwisweb1.dgif.virginia.gov/arcgis/rest/services/Public/DGIF_Public/MapServer

Simply trying to go after the DGIF_Lakes Map Service Layer: if ( registry.byId("layer4").get("checked") ) { clipLayers.push("DGIF_Lakes"); }

I have referenced the example and ESRI GP Service and I cannot see any reason for it not to work.  Maybe another set of eyes might find the flaw in the code?

THanks
0 Kudos
1 Solution

Accepted Solutions
ScottGunn
New Contributor III
Sorry, typoed that...this:
"Raster_Format" :  "ESRI GRID - GRID"


should be correct.

View solution in original post

0 Kudos
9 Replies
ScottGunn
New Contributor III
Jay,

Your GP Service looks like it requires four input parameters, "Layers_to_Clip", "Area_of_Interest", "Feature_Format", and "Raster_Format".  You're only passing in the first three params in your code:

  var params = {
            "Layers_to_Clip": clipLayers,
            "Area_of_Interest": featureSet,
            "Feature_Format": registry.byId("formatBox").get("value")
          };


I wonder if you can try passing a valid value into the paramaters like so:


  var params = {
            "Layers_to_Clip": clipLayers,
            "Area_of_Interest": featureSet,
            "Feature_Format": registry.byId("formatBox").get("value"),
            "Raster_Format": "ESRI GRID - GRID"
          };


I tried running the job manually here:
https://fwisweb1.dgif.virginia.gov/arcgis/rest/services/Public/ExtractDataTask/GPServer/Clip_n_Zip/s...
and it worked for me after doing a "Submit Job (GET)" so it seems like the service should work OK...I just think it's looking for that last parameter.

Scott
0 Kudos
jaykapalczynski
Frequent Contributor
Thanks will give that a Try...Is that the Correct Syntax

"Raster_Format" "ESRI GRID - GRID"

or something like

"Raster_Format" :  "ESRI GRID - GRID"

Still failing
0 Kudos
ScottGunn
New Contributor III
Sorry, typoed that...this:
"Raster_Format" :  "ESRI GRID - GRID"


should be correct.
0 Kudos
jaykapalczynski
Frequent Contributor
hmmmmm...tried the below mod and still job failed...


          
         var params = {
            "Layers_to_Clip": clipLayers,
            "Area_of_Interest": featureSet,
            "Feature_Format": registry.byId("formatBox").get("value"),
            "Raster_Format" : "ESRI GRID - GRID"
          };
0 Kudos
jaykapalczynski
Frequent Contributor
I ran with your link and there was an output although no DGIF_Lakes which makes sense because I did not define an area....ALTHOUGH there was a FC for each layer in the Map Service in the zip file.  I thought the code was just supposed to export the DGIF_Lakes (per my example)...hmmm

Weird that I am getting an error with my code but not with your example

https://fwisweb1.dgif.virginia.gov/dgifmapping/DataExtract2.html
0 Kudos
jaykapalczynski
Frequent Contributor
thought ....think I got it.....

Was referencing the Clip Layer name incorrectly....

I no longer get an error BUT the exported shapefile does NOT have any features in it????

Changed this
if ( registry.byId("layer4").get("checked") ) { clipLayers.push("DGIF_Lakes"); }


To This
if ( registry.byId("layer4").get("checked") ) { clipLayers.push("DGIF_Public.DBO.DGIF_Lakes"); }
0 Kudos
ScottGunn
New Contributor III
Awesome, nice catch!  Glad it worked out alright!
Scott
0 Kudos
jaykapalczynski
Frequent Contributor
Think I got it....BRB
0 Kudos
jaykapalczynski
Frequent Contributor
Thank you Scott for your eyes and the Raster Params catch....cheers
0 Kudos