Featurelayer ClearSelection

817
3
07-30-2018 08:45 AM
deleted-user-Qwv0Lt2wZ0Zu
New Contributor II

Hello,

I have downloaded the ArcGIS Runtime SDK for .NET 100.3 and I am noticing that the FeatureLayer.ClearSelection() method is very slow. I have a polygon feature class that represents a grid with 16x16m grid squares. The feature class contains 650,000 polygons. It takes about 6 seconds to run the ClearSelection method.

I know this sounds like a large number of features to search but I don't remember having slow performance with ClearSelection in the 100.2.1 version of the SDK. Have there been any changes to the ClearSelection() method at 100.3? And can you recommend any way that I might speed up searching for selected polygons within a layer that has this many features in it?

Thanks!

Jen

0 Kudos
3 Replies
deleted-user-Qwv0Lt2wZ0Zu
New Contributor II

Hello,

If anyone is interested...I solved my problem by keeping track of the last selected feature instead of using the ClearSelection() method on the feature layer. There is the ability to perform an 'Unselect' on a specific feature to avoid searching the entire feature layer. The search for selected features was the source of the slow performance in my application.

Instead of this....

FLayer.ClearSelection();

This...

Flayer.UnselectFeature(feature);

Regards!

Jen

0 Kudos
KrisFoster1
New Contributor II

Hi Jennifer,

I can confirm that I see the same performance issues with the ClearSelection method which is horrendously slow still at 100.4 API.  I've resorted to the same work around you have which is to keep track of my selected features myself and use the Flayer.UnselectFeatures(features);

Kind Regards,

Kris

MonikaLucas
New Contributor III

Eight months later I saw your post . Not sure how I missed it. Glad this was a successful approach for you.

Jen

0 Kudos