Select to view content in your preferred language

buffer return fetures from all layers

1269
10
04-12-2012 10:28 AM
LefterisKoumis
Frequent Contributor
I am looking for a  modified search widget specify a line and/or line buffer on a specified distance and return the features from other layers found within the selected buffer. Is there anything out there close to this functionality? Thank you.
Tags (2)
0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   The eSearch does exactly that.

http://www.arcgis.com/rc/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
[ATTACH=CONFIG]0[/ATTACH]
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   The eSearch does exactly that.

http://www.arcgis.com/rc/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
[ATTACH=CONFIG]0[/ATTACH]


Thank you. But how do you capture in the buffer, features from other layers and list them?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

    It is pretty straight forward.

  1. Choose the graphical search.

  2. Choose the layer that you will be searching.

  3. Check the buffer graphic checkbox and define the unit of measure and distance.

  4. If you are only going to draw a single graphic then uncheck enable multi-part graphics.

  5. Draw a graphic using one of the draw tools.

  6. If you unchecked the enable multi-part graphics in step 4 then that is it, if you left it checked then you have to click the search button.

I have some pretty in depth documentation pdfs in the download that you need to look at.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

    It is pretty straight forward.

  1. Choose the graphical search.

  2. Choose the layer that you will be searching.

  3. Check the buffer graphic checkbox and define the unit of measure and distance.

  4. If you are only going to draw a single graphic then uncheck enable multi-part graphics.

  5. Draw a graphic using one of the draw tools.

  6. If you unchecked the enable multi-part graphics in step 4 then that is it, if you left it checked then you have to click the search button.

I have some pretty in depth documentation pdfs in the download that you need to look at.


Thank you for the replay Robert. Sorry I didn't make myself clear. I am looking for the tool that will display all features within a buffer from ALL layers that have features within. The tool as it stands now, you have to select a layer at each time and apply the buffer. I'd like to take the chance and thank you so much for all your work.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Lefteris,

   There is no such widget as there is currently no good Flex API path for doing this. The find task will search all layers in a map service but it will only search based on a string and not geometry.
0 Kudos
LefterisKoumis
Frequent Contributor
Lefteris,

   There is no such widget as there is currently no good Flex API path for doing this. The find task will search all layers in a map service but it will only search based on a string and not geometry.


ok thanks. that's too bad. I was able to do something like this using javascript in arcims.
0 Kudos
MattiasEkström
Frequent Contributor
I'd say there is a Flex API path for doing this.
You can use the IdentifyTask with IdentifyParameters where you've set the geometry to the buffer and specified which layers you want to search by using LayerIds (for example all layers in the mapservice).
Or have I misunderstood something?
0 Kudos
KarlMagnusson
Deactivated User
I think you are correct Mattias. Using the identifyTask will do the trick as long as you have all your layers in one service. Combine multiple services (WebmapServers, WMS, WFS) in to one identifier task would have been great. Something for 3.1?
In addition to setting your buffered line as geometry in the identifyparameters you also need to set the layeroptions to "all". Something like his:
//Executes when drawing is completed assuming you draw your line
private function drawEnd(event:DrawEvent):void
   {
    
    var geom:Geometry = event.graphic.geometry;
    identifyParameters.returnGeometry = true;
    identifyParameters.tolerance = 3;
    identifyParameters.width = map.width;
    identifyParameters.height = map.height;
    identifyParameters.layerOption = "all";
    identifyParameters.mapExtent = map.extent;
    identifyTask.showBusyCursor = true;
    
    //Bufferering drawing
    var bufferParameters:BufferParameters = new BufferParameters();
    bufferParameters.geometries = [ geom ];
    bufferParameters.distances = [ <your buffer distance value> ];
    bufferParameters.unit = GeometryService.UNIT_METER;
    bufferParameters.outSpatialReference = map.spatialReference;
    bufferParameters.unionResults = true;
     
    geometryService.addEventListener(GeometryServiceEvent.BUFFER_COMPLETE, bufferCompleteHandler1);
    geometryService.buffer(bufferParameters);
     
    function bufferCompleteHandler1(event:GeometryServiceEvent):void
    {
     for each (var polygon:Polygon in event.result)
     {
      geometryService.removeEventListener(GeometryServiceEvent.BUFFER_COMPLETE, bufferCompleteHandler1);
      identifyParameters.geometry = polygon;
      identifyTaskIntresseletaren.execute(identifyParameters)
      break;
     }
    }
   }
   
<esri:GeometryService id="geometryService" url="<your geometry service> "/>
  
<esri:IdentifyParameters id="identifyParameters"/>
  
<esri:IdentifyTask id="identifyTask"
       concurrency="last"
       showBusyCursor="true"
 executeComplete="identifyTask_executeCompleteHandler(event)"/>



This will work as long as you don't combine your spatial search with a text search.

text search - use findtask
spatial search - use identifytask
text and spatial search - use querytask but can only search on one layer and field at a time
searching in one layer only - use querytask, much faster than findtask and identifytask

Karl M
Växjö municipality
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
You both are right, I though about that after I wrote that post but got to busy to post about the IdentifyTask. Needless to say Lefteris what looking for a developed widget that will do this and the exact workflow is not available in any widget that has been published by esri or the code gallery.
0 Kudos