Spatial Query Using Draw(Polyline) and Polygon

687
1
10-25-2013 02:30 PM
by Anonymous User
Not applicable
Hey Everyone

I am trying to create a spatial query using a polyline from the draw toolbar and an existing polygon dataset.  I would like to have the value of each polygon put into an array based on the order they are drawn over.  Currently I am using SPATIAL_REL_CROSS but it is placing the values into the array in a different order than I need.  I believe this has to do with the spatialRelationship type but have not been able to figure it out.  Any help would be greatly appreciated!

The idea behind this functionality was based on the following Flex widget:

Elevation Profiler


var polygonLayer = new esri.layers.FeatureLayer("***Feature Layer***",{
mode: esri.layers.FeatureLayer.MODE_SELECTION,
outFields: ['*']
});

var symbol;
symbol = new esri.symbol.SimpleFillSymbol();
var graphic = new esri.Graphic(evt.geometry, symbol);
map.graphics.add(graphic);

var spatialQuery = new esri.tasks.Query();
spatialQuery.spatialRelationship = esri.tasks.Query.SPATIAL_REL_CROSS;
spatialQuery.geometry = graphic.geometry;

polygonLayer.selectFeatures(spatialQuery, esri.layers.FeatureLayer.SELECTION_NEW, function(results){
  var sumValues = [];
  for(var i = 0; i < results.length; i++){
   sumValues.push(results.attributes['Sum_Values2']);
  }

Jeremy
0 Kudos
1 Reply
by Anonymous User
Not applicable
I realized I posted this last Friday afternoon, I figured I would bump it one time.  Anyone have any ideas?
0 Kudos