s.offermannconterra-de-esridist

Export image of GP tool layer does not work

Discussion created by s.offermannconterra-de-esridist Employee on May 24, 2012
Latest reply on May 29, 2012 by s.offermannconterra-de-esridist
I have a custom geoprocessing tool implemented in C#. The output is a GPRasterDataLayer. The tool is added as a tool layer to a blank ArcMap document. I have populated all parameters, set the scratch workspace to a folder and I have run the tool once. The output layer is added to the map as a sublayer to the tool layer as expected. The map is saved as mxd document and published to arcgis server, with MapServer and GeoprocessingServer capabilites enabled. Both services are created, the map server is the result service for the GP service.

I can execute the task sucessfully via REST interface of arcgis server. The problem is that the result only contains the URL to the gerenated tif file (parameter "out_result" of type GPRasterDataLayer), but the image can not be exported as a map image to be included in a javascript client.

http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/jcb8dd75cc1e341ac94f03c59e298b97b/results/out_result?f=pjson


=>

{
  "paramName" : "out_result",
  "dataType" : "GPRasterDataLayer",
  "value" : {
    "url" : "http://server/arcgisjobs/movingwindowfunction_gpserver/jcb8dd75cc1e341ac94f03c59e298b97b/scratch/Moving Window.tif",
    "format" : "tif"
  }
}


When using a map service as result service, this should not be the case regarding the documentation at:
http://services.arcgisonline.com/ArcGIS/SDK/REST/gpresult.html#mapimage

Map Images as Results
Map images can be a result of a GP job. If a GP service is associated with a result map service, the results of GPFeatureRecordSetLayer and GPRasterDataLayer data types can be drawn by the result map service and hence can be provided to the client as a map image.
In such cases where the result is a map image, the value field for the GP parameter is a JSON structure with a mapImage field.

So the value should be a "mapImage", but instead it is "url" and "format". I think this is a bug.

My next try is to export the image of the result using the export parameter of the GP service with the following URL:

http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j0684e2ad3c65427a9b469f74d0d824f6/results/out_result/export?dpi=96&transparent=true&format=png8&LANGUAGE=ger&bbox=-8192582.035679961,3318059.019542513,10592582.03567996,9481940.980457487&bboxSR=102100&imageSR=102100&size=1920,630&f=image


...which results in an error:
Error
Specified format is not supported
Code: 400
Invalid URL

Nothing helpful can be found in ArcGIS Server and REST log :(

What can I do to get the map image from the associated map service of the GP service?

Best regards, Stefan

Outcomes