# Can pass feature collection in GetIntersection method?

**URL:** <https://community.thinkgeo.com/t/can-pass-feature-collection-in-getintersection-method/8230>\
**Category:** WinForms\
**Created:** [October 13, 2016, 10:17am UTC](https://community.thinkgeo.com/t/can-pass-feature-collection-in-getintersection-method/8230 "2016-10-13T10:17:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goral](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Goral](https://community.thinkgeo.com/u/Goral)\
**Post date:** [October 13, 2016, 10:17am UTC](https://community.thinkgeo.com/t/can-pass-feature-collection-in-getintersection-method/8230/1 "2016-10-13T10:17:19Z")

</div>

Hi,

```
 imGrid.QueryTools.GetFeaturesIntersecting(feature[0], ReturningColumnsType.AllColumns);

```

this is the code using to get the intersecting feature.

My question is - any provision is there to pass whole feature collection at a time instead of single single feature?

Thanks,  
Goral

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [October 14, 2016, 5:01am UTC](https://community.thinkgeo.com/t/can-pass-feature-collection-in-getintersection-method/8230/3 "2016-10-14T05:01:55Z")

</div>

Hi Goral,

I think we don’t have an API for this requirement, if you don’t want to build loop code each time, you can build a custom function which handle all the features one by one.

Regards,

Don

---

<div class="post-metadata">

**Author:** ![Goral](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/g/4491bb/32.png) [@Goral](https://community.thinkgeo.com/u/Goral)\
**Post date:** [October 14, 2016, 8:55am UTC](https://community.thinkgeo.com/t/can-pass-feature-collection-in-getintersection-method/8230/4 "2016-10-14T08:55:07Z")

</div>

Hi,

Thanks for reply. I don’t want to build loop and also don’t want to handle features one by one. Because its taking time if number of features are more.Still Please give custom function sample to handle this.

Thanks,  
Goral

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [October 17, 2016, 5:48am UTC](https://community.thinkgeo.com/t/can-pass-feature-collection-in-getintersection-method/8230/5 "2016-10-17T05:48:28Z")

</div>

Hi Goral,

It should looks like:

```
  private Collection<Feature> HandleFeatures(Collection<Feature> features, FeatureLayer featureLayer)
    {
        Collection<Feature> resultFeatures = new Collection<Feature>();

        featureLayer.Open();

        foreach (Feature feature in features)
        {
            Collection<Feature> interFeatures = featureLayer.QueryTools.GetFeaturesIntersecting(feature, ReturningColumnsType.AllColumns);
            resultFeatures = new Collection<Feature>(resultFeatures.Union(interFeatures).ToList());
        }

        return resultFeatures;
    }

```

Regards,

Don
