<?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: Consume GeoProcessing Service in JS in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019462#M71472</link>
    <description>&lt;P&gt;If you wanna use ArcGIS REST services you'll have to use the request class from the API which could look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
        "esri/allyourotherclasses",
        "esri/request"
    ], function (allyourotherclasses, esriRequest, ) {
    let serviceURL 'URLtoyourservice/arcgis/rest/services/MYSERVICE/gptool';
     // this is the smaple data which has to be provided in unicode in the url
     // ?f=json&amp;amp;locations=[{"routeId":"60","measure":"0"}]&amp;amp;outSR=102100
    let request = 'f=json&amp;amp;locations=%5B%7B%22routeId%22%3A%2260%22%2C%22measure%22%3A%220%22%7D%5D&amp;amp;outSR=102100';

    let myURL = serviceURL += request;
    esriRequest(myURL, { responseType: 'json} ).then((response) =&amp;gt; {
    console.log(response.data);
    })
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to the unicode converter I've used:&lt;BR /&gt;&lt;A href="https://www.url-encode-decode.com/" target="_blank"&gt;https://www.url-encode-decode.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and here is the link to the ArcGIS REST API:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/get-started-with-the-services-directory.htm" target="_blank"&gt;https://developers.arcgis.com/rest/services-reference/get-started-with-the-services-directory.htm&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2021 14:00:29 GMT</pubDate>
    <dc:creator>ChristianBischof</dc:creator>
    <dc:date>2021-01-24T14:00:29Z</dc:date>
    <item>
      <title>Consume GeoProcessing Service in JS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1009085#M71097</link>
      <description>&lt;P&gt;Currently I'm working to develop an MVC Web application and I need to consume an ARCGis GeoProcessing service using Javascript to Calculate the displacement between two surfaces (Layers).&lt;/P&gt;&lt;P&gt;I have made lot of search in the internet to find some samples or code examples but without result.&lt;/P&gt;&lt;P&gt;Could you please share with me some samples link or some codes examples to get a start&lt;/P&gt;&lt;P&gt;below is the Geoprocessing Definition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; Task: Surface Difference Display Name: Surface Difference&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Description: Geoprocessing tool that calculates the volumetric&lt;BR /&gt;&amp;gt; difference between two surfaces.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Category:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Help URL:&lt;BR /&gt;&amp;gt; https://URL/arcgis/rest/directories/arcgisoutput/SurfaceDifference_GPServer/SurfaceDifference/SurfaceDifference.htm&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Execution Type: esriExecutionTypeAsynchronous&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameters:&lt;BR /&gt;Parameter: in_surface Data Type: GPString Display Name&lt;BR /&gt;&amp;gt; Input Surface Description: The terrain or TIN surface whose relative&lt;BR /&gt;&amp;gt; displacement is being evaluated from the reference surface. Direction:&lt;BR /&gt;&amp;gt; esriGPParameterDirectionInput Default Value: CB_1993_RasterTin&lt;BR /&gt;&amp;gt; Parameter Type: esriGPParameterTypeRequired Category: Choice List: [&lt;BR /&gt;&amp;gt; CB_1993_RasterTin, cb2003_RasterTin ]&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: in_reference_surface Data Type: GPString Display Name&lt;BR /&gt;&amp;gt; Reference Surface Description: The terrain or TIN surface that will be&lt;BR /&gt;&amp;gt; used as the baseline for determining the relative displacement of the&lt;BR /&gt;&amp;gt; input surface. Direction: esriGPParameterDirectionInput Default Value:&lt;BR /&gt;&amp;gt; cb2003_RasterTin Parameter Type: esriGPParameterTypeRequired Category:&lt;BR /&gt;&amp;gt; Choice List: [ cb_1994_RasterTin, cb2011_RasterTin, pu_2003_RasterTin,&lt;BR /&gt;&amp;gt; vid2000_RasterTin, CB_1993_RasterTin, cb2003_RasterTin ]&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: out_feature_class Data Type: GPFeatureRecordSetLayer&lt;BR /&gt;&amp;gt; Display Name Output Feature Class Description: The output feature&lt;BR /&gt;&amp;gt; class containing contiguous triangles and triangle parts that have the&lt;BR /&gt;&amp;gt; same classification grouped into polygons. The volume enclosed by each&lt;BR /&gt;&amp;gt; region of difference is listed in the attribute table. Direction:&lt;BR /&gt;&amp;gt; esriGPParameterDirectionOutput Default Value: Geometry Type:&lt;BR /&gt;&amp;gt; esriGeometryPolygon HasZ: false HasM: false Spatial Reference: null&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Fields: OID ( type: esriFieldTypeOID , alias: OID ) Volume ( type:&lt;BR /&gt;&amp;gt; esriFieldTypeDouble , alias: Volume ) SArea ( type:&lt;BR /&gt;&amp;gt; esriFieldTypeDouble , alias: SArea ) Code ( type: esriFieldTypeInteger&lt;BR /&gt;&amp;gt; , alias: Code ) Shape_Length ( type: esriFieldTypeDouble , alias:&lt;BR /&gt;&amp;gt; Shape_Length ) Shape_Area ( type: esriFieldTypeDouble , alias:&lt;BR /&gt;&amp;gt; Shape_Area ) Features: None.&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter Type: esriGPParameterTypeRequired Category:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: pyramid_level_resolution Data Type: GPDouble Display Name&lt;BR /&gt;&amp;gt; Pyramid Level Resolution Description: The terrain pyramid-level that&lt;BR /&gt;&amp;gt; will be used to generate the input surface. The default is 0, or full&lt;BR /&gt;&amp;gt; resolution. This parameter is only used with the terrain dataset.&lt;BR /&gt;&amp;gt; Direction: esriGPParameterDirectionInput Default Value: 0 Parameter&lt;BR /&gt;&amp;gt; Type: esriGPParameterTypeOptional Category:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: reference_pyramid_level_resolution Data Type: GPDouble&lt;BR /&gt;&amp;gt; Display Name Reference Surface Pyramid Level Resolution Description:&lt;BR /&gt;&amp;gt; The terrain pyramid-level that will be used to generate the reference&lt;BR /&gt;&amp;gt; surface. The default is 0, or full resolution. This parameter is only&lt;BR /&gt;&amp;gt; used with the terrain dataset. Direction:&lt;BR /&gt;&amp;gt; esriGPParameterDirectionInput Default Value: 0 Parameter Type:&lt;BR /&gt;&amp;gt; esriGPParameterTypeOptional Category:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: out_raster Data Type: GPRasterDataLayer Display Name Output&lt;BR /&gt;&amp;gt; Raster Description: The output raster surface whose values represent&lt;BR /&gt;&amp;gt; the input surface normalized against the reference surface. Positive&lt;BR /&gt;&amp;gt; values reflect areas where the input surface is above the reference&lt;BR /&gt;&amp;gt; surface, whereas negative values indicate the areas where the input&lt;BR /&gt;&amp;gt; surface is below the reference surface. The raster's values are&lt;BR /&gt;&amp;gt; derived from a TIN using linear interpolation. Direction:&lt;BR /&gt;&amp;gt; esriGPParameterDirectionOutput Default Value: Parameter Type:&lt;BR /&gt;&amp;gt; esriGPParameterTypeOptional Category: Raster Options&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: raster_cell_size Data Type: GPDouble Display Name Raster&lt;BR /&gt;&amp;gt; Cell Size Description: The cell size of the output raster. Direction:&lt;BR /&gt;&amp;gt; esriGPParameterDirectionInput Default Value: 10 Parameter Type:&lt;BR /&gt;&amp;gt; esriGPParameterTypeOptional Category: Raster Options&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Parameter: out_tin_basename Data Type: GPString Display Name Output&lt;BR /&gt;&amp;gt; TIN Base Name Description: The base name given to each output TIN&lt;BR /&gt;&amp;gt; surface. If one TIN dataset is not sufficient to represent the data,&lt;BR /&gt;&amp;gt; multiple TINs will be created with the same base name. Direction:&lt;BR /&gt;&amp;gt; esriGPParameterDirectionInput Default Value: Parameter Type:&lt;BR /&gt;&amp;gt; esriGPParameterTypeOptional Category: TIN Options&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt; Supported Operations: Submit Job&lt;/P&gt;&lt;P&gt;Many thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 15:15:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1009085#M71097</guid>
      <dc:creator>YassineKha</dc:creator>
      <dc:date>2020-12-12T15:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Consume GeoProcessing Service in JS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019462#M71472</link>
      <description>&lt;P&gt;If you wanna use ArcGIS REST services you'll have to use the request class from the API which could look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
        "esri/allyourotherclasses",
        "esri/request"
    ], function (allyourotherclasses, esriRequest, ) {
    let serviceURL 'URLtoyourservice/arcgis/rest/services/MYSERVICE/gptool';
     // this is the smaple data which has to be provided in unicode in the url
     // ?f=json&amp;amp;locations=[{"routeId":"60","measure":"0"}]&amp;amp;outSR=102100
    let request = 'f=json&amp;amp;locations=%5B%7B%22routeId%22%3A%2260%22%2C%22measure%22%3A%220%22%7D%5D&amp;amp;outSR=102100';

    let myURL = serviceURL += request;
    esriRequest(myURL, { responseType: 'json} ).then((response) =&amp;gt; {
    console.log(response.data);
    })
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a link to the unicode converter I've used:&lt;BR /&gt;&lt;A href="https://www.url-encode-decode.com/" target="_blank"&gt;https://www.url-encode-decode.com/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and here is the link to the ArcGIS REST API:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/services-reference/get-started-with-the-services-directory.htm" target="_blank"&gt;https://developers.arcgis.com/rest/services-reference/get-started-with-the-services-directory.htm&lt;/A&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 14:00:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019462#M71472</guid>
      <dc:creator>ChristianBischof</dc:creator>
      <dc:date>2021-01-24T14:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Consume GeoProcessing Service in JS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019622#M71482</link>
      <description>&lt;P&gt;You could try using the&amp;nbsp;&lt;A href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch" target="_self"&gt;native JavaScript fetch() API&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;A href="https://vanillajstoolkit.com/reference/ajax/fetch/" target="_blank"&gt;fetch() | The Vanilla JS Toolkit&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 14:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019622#M71482</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-01-25T14:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Consume GeoProcessing Service in JS</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019969#M71496</link>
      <description>&lt;P&gt;I have used this approach as well at some projects.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 10:24:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/consume-geoprocessing-service-in-js/m-p/1019969#M71496</guid>
      <dc:creator>ChristianBischof</dc:creator>
      <dc:date>2021-01-26T10:24:00Z</dc:date>
    </item>
  </channel>
</rss>

