I am trying to get the results of an identify task using ArcGIS JS API 2.7 into a featureSet so I can utilize this sample http://arcscripts.esri.com/details.asp?dbid=16528 that takes the results of a datagrid store and exports them to an excel file. I have it working where one feature is being exported, I just need to have all selected features export. Does an Identify Task produce a FeatureSet?


 function executeIdentifyTask(geom) {
  //clear the graphics layer 

  identifyParams.geometry = geom;
  identifyParams.mapExtent = map.extent;

 var polygonSymbol = new esri.symbol.SimpleFillSymbol(esri.symbol.SimpleFillSymbol.STYLE_SOLID, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_DOT, new dojo.Color([151, 249,0,.80]), 3), new dojo.Color([151, 249, 0, 0.45]));
     var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 20, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([0, 0, 0]), 1), new dojo.Color([25,50,225,0.3]));

     var controlItems = [];
     var surveyItems = [];


       var feature = result.feature;

       if (result.layerName =="surveys"){
              var attributes = feature.attributes;
    var csvTextSurv = "DOCUMENT_N;TOWNSHIP_RANGE;SECTION\n";  

    csvTextSurv += attributes["DOCUMENT_N"] + ";" +
                           attributes["TOWNSHIP_RANGE"] + ";" +
                           attributes["SECTION"] + "\n";

        document.getElementById("csvSurv").value = csvTextSurv; 
    var attributes = feature.attributes;
    var csvTextMons = "POINT_NAME;SECTION\n";  

    csvTextMons += attributes["POINT_NAME"] + ";" +
                           attributes["TOWNSHIP_RANGE"] + ";" +
                           attributes["SECTION"] + "\n";

     document.getElementById("csvMons").value = csvTextMons; 
   //add selected feature to graphics layer       

     if(surveyItems.length >0){
     var surveysStore = new dojo.data.ItemFileReadStore({data:   {identifier:'DOCUMENT_N',items:surveyItems}});
        var grid = dijit.byId('grid5');
 if(controlItems.length >0){
    var controlStore = new dojo.data.ItemFileReadStore({data:{identifier:'POINT_NAME',items:controlItems}});
    var grid = dijit.byId('grid4');




  • elaborate on what a featureset is? – Steve Mar 6 '12 at 17:46

If by featureSet you are referring to the geoJson spec then the answer is no. The identify task returns an identifyResult[]. This contains some basic information about each result and a graphic representation of the geometry.

It looks like the script you are wanting to use wants CSV so where does a FeatureSet come into play?

| improve this answer | |
  • Oops, I did not mean to end it there. I am not sure if the script I want to use needs a featureSet, I just can't figure out why I am only getting one result in my csv output, even though the datagrid displays all the results I select. It seems like it needs to loop through, but again I am not sure. Any ideas? – Em123 Mar 6 '12 at 19:10
  • might it be since you are overriding the place you are storing it? ie document.getElementById("csvSurv").value = csvTextSurv; where csvTextSurv is always going to be the last item? – Steve Mar 6 '12 at 22:24
  • Good point. I am such a newbie, what would I use instead to keep this from happening? – Em123 Mar 7 '12 at 19:40
  • += would append. – Steve Mar 8 '12 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.