<?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 Re: GPMultiValue and GPRasterDataLayer in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326348#M940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I created a model, composed of Mosaic to New Raster tool, which is supported by ArcGIS Runtime, in ArcGIS for Desktop. I have ran it successfully - the new mosaic was created. During the published of the resulting gpk, I chose the type of input_rasters as an user-defined value, not a default choice list. When I try to give my own input rasters, as described above, the gp service returns odd messages. Could you send me a link to any ArcGIS Runtime for Java sample application that uses GPMulitvalue with GPRasterDataLayer parameter? I can not find anything on the Internet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Dec 2014 09:52:17 GMT</pubDate>
    <dc:creator>AdamNicinski</dc:creator>
    <dc:date>2014-12-27T09:52:17Z</dc:date>
    <item>
      <title>GPMultiValue and GPRasterDataLayer</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326346#M938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I would like to ask you how I can pass a valid GPMultiValue with GPRasterDataLayer inside to the Local GP Service in ArcGIS Runtime 10.2.4. &lt;/P&gt;&lt;P&gt;My REST parameters are below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mosaic1.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/39732_mosaic1.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run my sample app, geoprocessing service starts. After I submit my jobs, it fails. There is nothing I can read from the job info. The job output is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="mosaic2.png" class="jive-image image-2" src="https://community.esri.com/legacyfs/online/39733_mosaic2.png" style="width: 620px; height: 247px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below you find my Java code for defining input parameters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;List&amp;lt;GPParameter&amp;gt; parameters = new ArrayList&amp;lt;&amp;gt;();
&amp;nbsp; inputRasters = new GPMultiValue&amp;lt;GPParameter&amp;gt;("input_rasters");

&amp;nbsp; GPLong bands = new GPLong("nmb_bands");
&amp;nbsp; bands.setValue(3);


&amp;nbsp; GPRasterDataLayer ras1 = new GPRasterDataLayer();
&lt;SPAN&gt;&amp;nbsp; ras1.setRasterDataUrl("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://127.0.0.1/zdjecia/lot1.tif" rel="nofollow noopener noreferrer" target="_blank"&gt;http://127.0.0.1/zdjecia/lot1.tif&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;
&amp;nbsp; ras1.setFormat("tif");

&amp;nbsp; GPRasterDataLayer ras2 = new GPRasterDataLayer();
&lt;SPAN&gt;&amp;nbsp; ras2.setRasterDataUrl("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://127.0.0.1/zdjecia/lot2.tif" rel="nofollow noopener noreferrer" target="_blank"&gt;http://127.0.0.1/zdjecia/lot2.tif&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;
&amp;nbsp; ras2.setFormat("tif");

&amp;nbsp; GPRasterDataLayer ras3 = new GPRasterDataLayer();
&lt;SPAN&gt;&amp;nbsp; ras3.setRasterDataUrl("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://127.0.0.1/zdjecia/lot3.tif" rel="nofollow noopener noreferrer" target="_blank"&gt;http://127.0.0.1/zdjecia/lot3.tif&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;
&amp;nbsp; ras3.setFormat("tif");

&amp;nbsp; GPRasterDataLayer ras4 = new GPRasterDataLayer();
&lt;SPAN&gt;&amp;nbsp; ras4.setRasterDataUrl("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://127.0.0.1/zdjecia/lot4.tif" rel="nofollow noopener noreferrer" target="_blank"&gt;http://127.0.0.1/zdjecia/lot4.tif&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;
&amp;nbsp; ras4.setFormat("tif");


&amp;nbsp; inputRasters.addValue(bands);
&amp;nbsp; inputRasters.addValue(ras1);
&amp;nbsp; inputRasters.addValue(ras2);
&amp;nbsp; inputRasters.addValue(ras3);
&amp;nbsp; inputRasters.addValue(ras4);

&amp;nbsp; parameters.add(inputRasters);

&amp;nbsp; parameters.add(bands);

&amp;nbsp; String gpUrl = MosiacService.getUrlGeoprocessingService() + "/MosaicToRaster";
&amp;nbsp; MosaicGP = new Geoprocessor(gpUrl);



MosaicGP.submitJobAndGetResultsAsync(parameters, null,new String[]{"mosaic_out"}, new GPCallback());




&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the documentation, if GPRasterDataLayer is an input, I should pass a JSON like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; {
 "paramName" : "&amp;lt;paramName&amp;gt;",
 "dataType" : "&amp;lt;GPRasterDataLayer | GPFeatureRecordSetLayer&amp;gt;",
 "value" : 
&amp;nbsp; { 
&amp;nbsp; "mapImage" : 
&amp;nbsp; {
&amp;nbsp; "href" : "&amp;lt;href&amp;gt;",
&amp;nbsp; "width" : &amp;lt;width&amp;gt;,
&amp;nbsp; "height" : &amp;lt;height&amp;gt;,
&amp;nbsp; "extent" : {&amp;lt;envelope&amp;gt;},
&amp;nbsp; "scale" : &amp;lt;scale&amp;gt;
&amp;nbsp;&amp;nbsp; } 
&amp;nbsp; }
 }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there are only methods to add URL and Format to GPRasterDataLayer.&amp;nbsp; BTW, adding input rasters using URL is not a convenient way for me. Is it a way to add rasters using local paths? As far as I know the uploads are not currently supported by ArcGIS Runtime GP, so there is no option to pass itemId as an input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:28:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326346#M938</guid>
      <dc:creator>AdamNicinski</dc:creator>
      <dc:date>2021-12-11T15:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: GPMultiValue and GPRasterDataLayer</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326347#M939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Was you GP model successful in Desktop? I assume it was, for you to be able to create a gpk, yes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Dec 2014 22:22:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326347#M939</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2014-12-23T22:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: GPMultiValue and GPRasterDataLayer</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326348#M940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I created a model, composed of Mosaic to New Raster tool, which is supported by ArcGIS Runtime, in ArcGIS for Desktop. I have ran it successfully - the new mosaic was created. During the published of the resulting gpk, I chose the type of input_rasters as an user-defined value, not a default choice list. When I try to give my own input rasters, as described above, the gp service returns odd messages. Could you send me a link to any ArcGIS Runtime for Java sample application that uses GPMulitvalue with GPRasterDataLayer parameter? I can not find anything on the Internet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Dec 2014 09:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326348#M940</guid>
      <dc:creator>AdamNicinski</dc:creator>
      <dc:date>2014-12-27T09:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: GPMultiValue and GPRasterDataLayer</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326349#M941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that I found the issue. Unfortunately, It must be a bug in Runtime 10.2.4. After having enabled logging in LocalServer Utility, It turned out that ArcGIS Runtime sent a wrong-encoded request to the REST endpoint. There are many extra&amp;nbsp; " and \ signs, which make the request invalid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the wrong request made by Runtime:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;submitJob?input_rasters=["{\"format\":\"tif\",\"url\":\"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot1.tif" target="_blank"&gt;http://localhost/lot1.tif&lt;/A&gt;&lt;SPAN&gt;\"}","{\"format\":\"tif\",\"url\":\"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot2.tif" target="_blank"&gt;http://localhost/lot2.tif&lt;/A&gt;&lt;SPAN&gt;\"}","{\"format\":\"tif\",\"url\":\"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot3.tif" target="_blank"&gt;http://localhost/lot3.tif&lt;/A&gt;&lt;SPAN&gt;\"}","{\"format\":\"tif\",\"url\":\"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot4.tif" target="_blank"&gt;http://localhost/lot4.tif&lt;/A&gt;&lt;SPAN&gt;\"}"]&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;f=json&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;|The good request is below (tested in REST API endpoint):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;submitJob?input_rasters=[{ "url" : "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot1.tif" target="_blank"&gt;http://localhost/lot1.tif&lt;/A&gt;&lt;SPAN&gt;", "format" : "tif" },{ "url" : "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot2.tif" target="_blank"&gt;http://localhost/lot2.tif&lt;/A&gt;&lt;SPAN&gt;", "format" : "tif" },{ "url" : "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Flot3.tif" target="_blank"&gt;http://localhost/lot3.tif&lt;/A&gt;&lt;SPAN&gt;", "format" : "tif" }]&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;f=json&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover, I would like to point out a few things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Rest API, apparently, supports local path to the GPRasterDataLayer parameter in the following format&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{ "url" : "C:/Tools/ChangeDetection/zm1wgs.tif", "format" : "tif" }.&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, ArcGIS Runtime SDK 10.2.4 does NOT. When using "&lt;CODE&gt;&lt;SPAN class="str" style="color: #800000;"&gt;file:///&lt;/SPAN&gt;&lt;/CODE&gt;" prefix, Runtime creates this json:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{ "url" : "file:/C:/Tools/ChangeDetection/zm1wgs.tif", "format" : "tif" } &lt;/PRE&gt;&lt;P&gt;which is in fact incorrect path. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) "Mosaic To New Raster' tool is not supported when creating GPK from ArcGIS Desktop 10.3.1 (with MPK patch installed). Runtime shows the error: &lt;SPAN style="font-weight: bold; color: #6a6a6a; font-family: arial, sans-serif; font-size: small;"&gt;ERROR 000816: The tool is not valid&lt;/SPAN&gt;&lt;SPAN style="color: #545454; font-family: arial, sans-serif; font-size: small;"&gt;.&lt;/SPAN&gt; This must be a bug as well. When creating the same GPK from ArcGIS 10.2.2, the tool works as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) The input GPRasterDataLayer geoprocessing parameters can be defined as below. It works just fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;GPRasterDataLayer rasterAfter = new GPRasterDataLayer("rasterAfter");&amp;nbsp; 
&lt;SPAN&gt;rasterAfter.setRasterDataUrl("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Flocalhost%2Fzm1wgs.tif" target="_blank"&gt;http://localhost/zm1wgs.tif&lt;/A&gt;&lt;SPAN&gt;");&amp;nbsp; &lt;/SPAN&gt;
rasterAfter.setFormat("tif");&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope, you find these comments useful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;Użyj zaawansowanego edytora&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:28:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326349#M941</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2021-12-11T15:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: GPMultiValue and GPRasterDataLayer</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326350#M942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for these clues. Give us a chance to investigate and we'll see what's up. I assume you do not have access to Esri's Technical Support? If you do, by chance, no harm in logging this officially.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Dec 2015 16:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326350#M942</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2015-12-22T16:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: GPMultiValue and GPRasterDataLayer</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326351#M943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I don't have access to Esri's Technical Support as I am an EDN user only. As I suppose, there won't be any new release of ArcGIS Runtime, so I look forward to see the bug fixes in the Quartz final release. The sooner is the better!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Dec 2015 07:07:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/gpmultivalue-and-gprasterdatalayer/m-p/326351#M943</guid>
      <dc:creator>nita14</dc:creator>
      <dc:date>2015-12-23T07:07:27Z</dc:date>
    </item>
  </channel>
</rss>

