ThinkGeo.com    |     Documentation    |     Premium Support

Can pass feature collection in GetIntersection method?

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

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

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

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