Geoprocessor issue (Extract Data)

Jump to solution
11-16-2016 10:13 AM
by Anonymous User
Not applicable

Hi all I am trying to export my data via the Extract Data geoporcesssing service but I am experiencing some errors. I am trying to reproduce something similar this: Download Map Graphics - GIS Blog: ArcGIS in the Cloud, Server Hosting & More | ROK Technologies . The goal is to export graphics to FGDB after you are done with drawing.

        var map;

          function (
            InfoTemplate, Map, FeatureLayer, SimpleFillSymbol, SimpleLineSymbol,
            Query, Draw, GeometryService, Geoprocessor, Graphic, graphicsUtils, FeatureSet, Extent,
            SpatialReference, dom, on, parser, arrayUtil, Color
          ) {
              //Parsing data

              var selectionToolbar, featureLayer;

              var extent = new esri.geometry.Extent({
                  "xmin": -121.11087086999999, "ymin": 38.517479534000074, "xmax": -119.95226375799996, "ymax": 39.068026806000034,
                  "spatialReference": { "wkid": 4326 }

              map = new Map("map", {
                  basemap: "topo",
                  extent: extent

              //Panel widget
              var a = false;
              $("#SelectWidget").click(function () {
                  if (!a) {
                      a = true;
                      $("#Area").show("slow", function () { });
                      $('#map').css("height", "80%");
                  else {
                      a = false;
                      $("#Area").hide("slow", function () { });
                      $('#map').css("height", "100%");

              // Map on load
              map.on("load", initSelectToolbar);

              //My feature layer
              featureLayer = new FeatureLayer("http://itas46:6080/arcgis/rest/services/Alex_test/TreeMortality/MapServer/1",
                    mode: FeatureLayer.MODE_ONDEMAND

              //Add layer here

              var gp = new Geoprocessor("http://itas46:6080/arcgis/rest/services/Alex_test/ExtractDataModel/GPServer/Model");

              //Activate the draw tool
              $("#selectFieldsButton").click(function () {

              //On Map load have the Draw Toolbar ready to be activated and the union tool ready to be fired up
              function initSelectToolbar(event) {
                  console.log("start edits");
                  selectionToolbar = new Draw(;
                  var selectQuery = new Query();
                  var targetGeometry;
                  on(selectionToolbar, "DrawEnd", function (geometry) {
                      var geometryService = new GeometryService("http://itas46:6080/arcgis/rest/services/Utilities/Geometry/GeometryServer");
                      selectQuery.geometry = geometry;
                      featureLayer.selectFeatures(selectQuery, FeatureLayer.SELECTION_NEW, function (targetGeometry) {
                          targetGeometry = graphicsUtils.getGeometries(featureLayer.getSelectedFeatures());
                          geometryService.union(targetGeometry, function (geometry) {
                              //Graphics to be shown on web map
                              var symbol = new SimpleFillSymbol("none", new SimpleLineSymbol("solid", new Color([255, 255, 255]), 2), new Color([255, 255, 255, 0.25]));
                              var graphic = new Graphic(geometry, symbol);
                              //feature set
                              var features = [];
                              var fSet = new FeatureSet();
                              fSet.features = features;
                              console.log("Test =" + fSet);
                              //Geoporcessing serice

                              var params = {
                                  "FeaturesetGraphs": fSet,
                                  "testAlex_zip": $("#inputlg").val()

                              gp.execute(params, getgdb);
                              function getgdb(result, messages) {
                              console.log("unioned features");
                          }, function (err) {


My Model:

The error I get:

My gp service looks like this:

Any idea why I am getting errors on the GP side?

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

found my issue was that I run an asynchronous job using "execute()" when execute is for a synchronous job.

View solution in original post

0 Kudos
1 Reply
by Anonymous User
Not applicable

found my issue was that I run an asynchronous job using "execute()" when execute is for a synchronous job.

0 Kudos