<?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: Summarize Elevation Geoprocessing Task Failures in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51487#M4535</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use this service, but I am stuck at the point where token is generated. I tried it using proxy, but it did not woork. Then, am trying using esri/request. The code is below. Can you help me please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;layersRequest &lt;/SPAN&gt;= esriRequest({
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;url&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"h&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.arcgis.com/sharing/rest/oauth2/token/" rel="nofollow noopener noreferrer" target="_blank"&gt;ttps://www.arcgis.com/sharing/rest/oauth2/token/&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;content&lt;/SPAN&gt;: { &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;f&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"json" &lt;/SPAN&gt;},
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;handleAs&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"json"&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;callbackParamName&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"callback"&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;usePost&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"true"&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;form&lt;/SPAN&gt;: {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'json'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'client_id'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'YOUR_APPLICATIONS_CLIENT_ID'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'client_secret'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'YOUR_APPLICATIONS_CLIENT_SECRET'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'grant_type'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'client_credentials'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'expiration'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'1440'
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp; &lt;/SPAN&gt;}
});
&lt;SPAN style="color: #458383;"&gt;layersRequest&lt;/SPAN&gt;.then(
&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;function&lt;/SPAN&gt;(response) {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;console&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;log&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Success: "&lt;/SPAN&gt;, response.layers);
&amp;nbsp; }, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;function&lt;/SPAN&gt;(error) {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;console&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;log&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Error: "&lt;/SPAN&gt;, error.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;message&lt;/SPAN&gt;);
&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:59:08 GMT</pubDate>
    <dc:creator>ShilpiJain1</dc:creator>
    <dc:date>2021-12-10T21:59:08Z</dc:date>
    <item>
      <title>Summarize Elevation Geoprocessing Task Failures</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51485#M4533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying to setup a connection from a custom JS API webapp to use the&lt;A href="https://developers.arcgis.com/rest/elevation/api-reference/summarize-elevation.htm"&gt; Summarize Elevation GP Task&lt;/A&gt;. No matter what I do, the task fails with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14103887163357734" jivemacro_uid="_14103887163357734"&gt;&lt;SPAN style="font-family: 'andale mono', times;"&gt;jobStatus: "esriJobFailed"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;And the description for the failure is just "Failed.". The idea is that a user clicks a polygon, and in the infowindow is a button that allows them to get the elevation summary. When clicking the elevation button, it passes the selected feature to a function that submits the GP job. Below is a code snippet of what I've been trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14103889325234880" jivemacro_uid="_14103889325234880"&gt;
&lt;P&gt;getSlope: function (feature) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var gpElev, params, featureSet, features = [];&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; gpElev = new Geoprocessor("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://elevation.arcgis.com/arcgis/rest/services/Tools/Elevation/GPServer/SummarizeElevation" rel="nofollow" target="_blank"&gt;http://elevation.arcgis.com/arcgis/rest/services/Tools/Elevation/GPServer/SummarizeElevation&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; featureSet = new FeatureSet();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; features.push(feature);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; featureSet.features = features;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; params = {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "InputFeatures": featureSet,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "DEMResolution": "FINEST",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "IncludeSlopeAspect": true&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function elevSuccess (r) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(r);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function elevStatus (s) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(s);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function elevError (e) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(e);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(params);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpElev.submitJob(params, elevSuccess, elevStatus, elevError);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(gpElev);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never really messed around with GP tasks from the web api so maybe I'm just doing something wrong here? Also I should note that I'm using a proxy to grab a token for the GP service, but I get the same results with or without.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All my features are in wkid: 102100 and are retrieved from Server 10.22 with a SQL Server enterprise DB. Web servers tried on both IIS on Server 2012 R2 and Apache2 on Ubuntu Server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Sep 2014 22:50:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51485#M4533</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2014-09-10T22:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize Elevation Geoprocessing Task Failures</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51486#M4534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I figured out what was wrong here. I needed to set the fields parameter of the featureSet. Unfortunately, the fields parameter is not even listed in the API documentation for FeatureSet and the examples I looked at didn't show it either. Fortunately I was able to look through the code for the &lt;A href="https://github.com/Esri/elevation-profile-template"&gt;Elevation Profile template&lt;/A&gt; that Esri provides and saw how to setup the FeatureSet and get this to work correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At any rate, the working code is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14109151337691595 jive_text_macro" jivemacro_uid="_14109151337691595"&gt;
&lt;P&gt;getSlope: function (feature) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var params, gpElev, featureSet;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; gpElev = new Geoprocessor("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://elevation.arcgis.com/arcgis/rest/services/Tools/Elevation/GPServer/SummarizeElevation" rel="nofollow" target="_blank"&gt;https://elevation.arcgis.com/arcgis/rest/services/Tools/Elevation/GPServer/SummarizeElevation&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; featureSet = new FeatureSet();&lt;/P&gt;
&lt;P&gt;&amp;nbsp; featureSet.features = [feature];&lt;/P&gt;
&lt;P&gt;&amp;nbsp; featureSet.fields = [{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "name": "OBJECTID",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "type": "esriFieldTypeObjectID",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "alias": "OBJECTID"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }];&lt;/P&gt;
&lt;P&gt;&amp;nbsp; params = {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "InputFeatures": featureSet,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "DEMResolution": "FINEST",&lt;/P&gt;
&lt;P&gt;&amp;nbsp; "IncludeSlopeAspect": true&lt;/P&gt;
&lt;P&gt;&amp;nbsp; };&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function elevSuccess(r) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(r);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; // now run gpElev.getResultData to retrieve the results&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function elevStatus(s) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(s);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; function elevError(e) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log(e);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp; gpElev.submitJob(params, elevSuccess, elevStatus, elevError);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; }&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 00:52:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51486#M4534</guid>
      <dc:creator>ToddAtkins</dc:creator>
      <dc:date>2014-09-17T00:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Summarize Elevation Geoprocessing Task Failures</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51487#M4535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use this service, but I am stuck at the point where token is generated. I tried it using proxy, but it did not woork. Then, am trying using esri/request. The code is below. Can you help me please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;var &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;layersRequest &lt;/SPAN&gt;= esriRequest({
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;url&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"h&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.arcgis.com/sharing/rest/oauth2/token/" rel="nofollow noopener noreferrer" target="_blank"&gt;ttps://www.arcgis.com/sharing/rest/oauth2/token/&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;content&lt;/SPAN&gt;: { &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;f&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"json" &lt;/SPAN&gt;},
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;handleAs&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"json"&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;callbackParamName&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"callback"&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;usePost&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"true"&lt;/SPAN&gt;,
&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;form&lt;/SPAN&gt;: {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'f'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'json'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'client_id'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'YOUR_APPLICATIONS_CLIENT_ID'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'client_secret'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'YOUR_APPLICATIONS_CLIENT_SECRET'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'grant_type'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'client_credentials'&lt;/SPAN&gt;,
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;'expiration'&lt;/SPAN&gt;: &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'1440'
&lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&amp;nbsp; &lt;/SPAN&gt;}
});
&lt;SPAN style="color: #458383;"&gt;layersRequest&lt;/SPAN&gt;.then(
&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;function&lt;/SPAN&gt;(response) {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;console&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;log&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Success: "&lt;/SPAN&gt;, response.layers);
&amp;nbsp; }, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;function&lt;/SPAN&gt;(error) {
&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;console&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;log&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"Error: "&lt;/SPAN&gt;, error.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;message&lt;/SPAN&gt;);
&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/summarize-elevation-geoprocessing-task-failures/m-p/51487#M4535</guid>
      <dc:creator>ShilpiJain1</dc:creator>
      <dc:date>2021-12-10T21:59:08Z</dc:date>
    </item>
  </channel>
</rss>

