<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Export image of GP tool layer does not work in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547311#M50975</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/jcb8dd75cc1e341ac94f03c59e298b97b/results/out_result?f=pjson&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
&amp;nbsp; "paramName" : "out_result",
&amp;nbsp; "dataType" : "GPRasterDataLayer",
&amp;nbsp; "value" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "url" : "http://server/arcgisjobs/movingwindowfunction_gpserver/jcb8dd75cc1e341ac94f03c59e298b97b/scratch/Moving Window.tif",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "format" : "tif"
&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using a map service as result service, this should not be the case regarding the documentation at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://services.arcgisonline.com/ArcGIS/SDK/REST/gpresult.html#mapimage" rel="nofollow noopener noreferrer" target="_blank"&gt;http://services.arcgisonline.com/ArcGIS/SDK/REST/gpresult.html#mapimage&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Map Images as Results&lt;BR /&gt;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.&lt;BR /&gt;&lt;STRONG&gt;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.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;So the value should be a "mapImage", but instead it is "url" and "format". I think this is a bug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My next try is to export the image of the result using the export parameter of the GP service with the following URL:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j0684e2ad3c65427a9b469f74d0d824f6/results/out_result/export?dpi=96&amp;amp;transparent=true&amp;amp;format=png8&amp;amp;LANGUAGE=ger&amp;amp;bbox=-8192582.035679961,3318059.019542513,10592582.03567996,9481940.980457487&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=1920,630&amp;amp;f=image&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...which results in an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Error&lt;BR /&gt;Specified format is not supported&lt;BR /&gt;Code: 400&lt;BR /&gt;Invalid URL&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Nothing helpful can be found in ArcGIS Server and REST log &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What can I do to get the map image from the associated map service of the GP service?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards, Stefan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:41:03 GMT</pubDate>
    <dc:creator>StefanOffermann</dc:creator>
    <dc:date>2021-12-11T23:41:03Z</dc:date>
    <item>
      <title>Export image of GP tool layer does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547311#M50975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/jcb8dd75cc1e341ac94f03c59e298b97b/results/out_result?f=pjson&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
&amp;nbsp; "paramName" : "out_result",
&amp;nbsp; "dataType" : "GPRasterDataLayer",
&amp;nbsp; "value" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "url" : "http://server/arcgisjobs/movingwindowfunction_gpserver/jcb8dd75cc1e341ac94f03c59e298b97b/scratch/Moving Window.tif",
&amp;nbsp;&amp;nbsp;&amp;nbsp; "format" : "tif"
&amp;nbsp; }
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When using a map service as result service, this should not be the case regarding the documentation at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://services.arcgisonline.com/ArcGIS/SDK/REST/gpresult.html#mapimage" rel="nofollow noopener noreferrer" target="_blank"&gt;http://services.arcgisonline.com/ArcGIS/SDK/REST/gpresult.html#mapimage&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Map Images as Results&lt;BR /&gt;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.&lt;BR /&gt;&lt;STRONG&gt;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.&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;So the value should be a "mapImage", but instead it is "url" and "format". I think this is a bug.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My next try is to export the image of the result using the export parameter of the GP service with the following URL:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://some.server.com/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j0684e2ad3c65427a9b469f74d0d824f6/results/out_result/export?dpi=96&amp;amp;transparent=true&amp;amp;format=png8&amp;amp;LANGUAGE=ger&amp;amp;bbox=-8192582.035679961,3318059.019542513,10592582.03567996,9481940.980457487&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=1920,630&amp;amp;f=image&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...which results in an error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Error&lt;BR /&gt;Specified format is not supported&lt;BR /&gt;Code: 400&lt;BR /&gt;Invalid URL&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Nothing helpful can be found in ArcGIS Server and REST log &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What can I do to get the map image from the associated map service of the GP service?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards, Stefan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547311#M50975</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2021-12-11T23:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Export image of GP tool layer does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547312#M50976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think I have solved my problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The name of the result sub layer of the tool layer must have the same name as the output parameter of the GP tool (in my case: "out_result").&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this is done, then I get the correct output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
&amp;nbsp; "paramName" : "out_result", 
&amp;nbsp; "dataType" : "GPRasterDataLayer", 
&amp;nbsp; "value" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "mapImage" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "href" : "http://server/arcgisoutput/_ags_map4a0e89d03bf04fad94febbf29e553660.png", 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "width" : 400, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "height" : 400, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "extent" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmin" : -198, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymin" : -188.48, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmax" : 198, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymax" : 207.52, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "spatialReference" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "wkid" : 4326
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "scale" : 416060611.02672
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547312#M50976</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2021-12-11T23:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export image of GP tool layer does not work</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547313#M50977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The problem still exists &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything works fine on the server side: The tool is running, the output raster image is created in the jobs directory and now even the image is written in the output directory:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;URL: &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://server/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j39af1a9452014046b5eff75461283d0a/results/out_result?f=pjson&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Output: &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
&amp;nbsp; "paramName" : "out_result", 
&amp;nbsp; "dataType" : "GPRasterDataLayer", 
&amp;nbsp; "value" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp; "mapImage" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "href" : "http://server/arcgisoutput/_ags_map4a0b366dc2a6406c8e01f5dabbd537b6.png", 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "width" : 400, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "height" : 400, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "extent" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmin" : -7.23306324850746, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymin" : 43.5062588282437, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "xmax" : 5.26322179315017, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ymax" : 56.0025438699013, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "spatialReference" : {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "wkid" : 4326
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "scale" : 13129323.207061
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to call the gp service from my javascript client, I use this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;this.gpTask.getResultImageLayer(jobInfo.jobId, "out_result", imageParams, dojo.hitch(this,function(gpLayer){ ...&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This does not work, as I can see in the javascript console of chrome, the following URL is generated to export the image from the gp service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://server/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j39af1a9452014046b5eff75461283d0a/results/out_result/export?dpi=96&amp;amp;transparent=true&amp;amp;format=png8&amp;amp;bbox=31124.96346345375,6358724.004726038,618161.340693325,6471850.806588045&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=1920,370&amp;amp;f=image&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;which results in an error (web site of the rest endpoint):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Specified format is not supported&lt;BR /&gt;Code: 400&lt;BR /&gt;Invalid URL&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I change the URL from "f=image" to "f=pjson", I an see a similar error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;http://server/ArcGIS/rest/services/MovingWindowFunction/GPServer/Moving%20Window%20Function/jobs/j39af1a9452014046b5eff75461283d0a/results/out_result/export?dpi=96&amp;amp;transparent=true&amp;amp;format=png8&amp;amp;bbox=31124.96346345375,6358724.004726038,618161.340693325,6471850.806588045&amp;amp;bboxSR=102100&amp;amp;imageSR=102100&amp;amp;size=1920,370&amp;amp;f=pjson&lt;/PRE&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;{&lt;BR /&gt;&amp;nbsp; "error" : &lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "code" : 400, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "message" : "Unable to complete&amp;nbsp; operation.", &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "details" : [&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Invalid URL"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ]&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why is it not possible to use the "export" map parameter of the gp service (with a result map service)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards, Stefan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/export-image-of-gp-tool-layer-does-not-work/m-p/547313#M50977</guid>
      <dc:creator>StefanOffermann</dc:creator>
      <dc:date>2021-12-11T23:41:09Z</dc:date>
    </item>
  </channel>
</rss>

