Buffer multiple polygons > Send results to FeatureTable

680
3
Jump to solution
08-03-2022 02:48 PM
khanley
New Contributor II

I'm attempting to create a buffer option on my map that will take any number of features, buffer all parcels within 300 feet of the parcels selected, and then show the results in a FeatureTable, as well as highlight those features within the radii on my map.

I have the buffer working for a single feature, and have it filtering the geometry to the FeatureTable, but I can't quite figure out how to get it working with an array. I also can't figure out how to highlight the returned features on the map.

Here is my code so far:

      function buffertheSelection(event) {
          var parcel = [];
          var dist = [];
          dist.push(300);
          for (i=0; i < features.length; i++){
            parcel.push(features[i].feature.geometry);
          }
          const ptBuff = geometryEngine.buffer(parcel, dist, "feet");
          featureTable.clearSelectionFilter();
          for (i=0; i < ptBuff.length; i++){
            featureTable.filterGeometry = ptBuff[i].extent;
          }
}

 

0 Kudos
1 Solution

Accepted Solutions
ReneRubalcava
Frequent Contributor

One of the options for the geometryEngine buffer is unionResults

https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buff...

This will return a single buffer geometry for all the geometries buffered and you can use that in the filter.

View solution in original post

3 Replies
UndralBatsukh
Esri Regular Contributor

Hi there, 

Have you seen this sample: https://developers.arcgis.com/javascript/latest/sample-code/highlight-features-by-geometry/? Sounds like you are doing what this sample shows.

ReneRubalcava
Frequent Contributor

One of the options for the geometryEngine buffer is unionResults

https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-geometryEngine.html#buff...

This will return a single buffer geometry for all the geometries buffered and you can use that in the filter.

khanley
New Contributor II

Thank you so much.

0 Kudos