I created a geoprocessing (GP) task to extract features from a SDE geodatabase. I created the GP task and added it to my MXD using the instructions from this video: http://www.youtube.com/watch?v=HsMK9ZtYN5k.
The GP works as expected when initiated from ArcMap by right clicking on the "Extract Data Task," selecting "Open," then interactively drawing a graphic for clipping the features. However, the GP does not clip the features when initiated from my sample website (http://gis.fortlauderdale.gov/DataDownloads/esriSample.html). It initiates the GP but the resulting files that are downloaded only contain the structure of the files. They do not include any features. It is almost as if the application is ignoring my interactive graphic. This is getting frustrating as I've spent several days trying to figure out the problem. I am hoping someone will please chime in to provide some assistance.
function initSelectionToolbar(myMap) { selectionToolbar = new esri.toolbars.Draw(map); dojo.connect(selectionToolbar, "onDrawEnd", function (geometry) { selectionToolbar.deactivate(); var symbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DASHDOT, new dojo.Color([255, 0, 0]), 2), new dojo.Color([255, 255, 0, 0.25])); var graphic = new esri.Graphic(geometry, symbol); map.graphics.add(graphic);
}); } function activateTool(type) { selectionToolbar.activate(); }
function extractData() { //get clip layers var clipLayers = []; if (dijit.byId('layer1').checked) { clipLayers.push('HWY2010'); } if (dijit.byId('layer2').checked) { clipLayers.push('RRX2010'); } if (dijit.byId('layer3').checked) { clipLayers.push('STR2010'); } if (clipLayers.length === 0 || map.graphics.graphics.length === 0) { alert('Select layers to extract and area of interest'); return; } var features = []; features.push(map.graphics.graphics[0]); var featureSet = new esri.tasks.FeatureSet(); featureSet.features = features;
var params = { "Layers_to_Clip": clipLayers, "Area_of_Interest": featureSet, "Feature_Format": dijit.byId('formatBox').value } esri.show(loading); gp.submitJob(params, completeCallback, statusCallback, function (error) { alert(error); esri.hide(loading); }); } function completeCallback(jobInfo) { if (jobInfo.jobStatus !== "esriJobFailed") { gp.getResultData(jobInfo.jobId, "Output_Zip_File", downloadFile); } } function statusCallback(jobInfo) { var status = jobInfo.jobStatus; if (status === "esriJobFailed") { alert(status); esri.hide(loading); } else if (status === "esriJobSucceeded") { esri.hide(loading); } } function downloadFile(outputFile) { map.graphics.clear(); var theurl = outputFile.value.url; window.location = theurl;
esri.setRequestPreCallback(function (ioargs) { if (ioargs.content.Area_of_Interest) { var aoijson = dojo.fromJson(ioargs.content.Area_of_Interest);