How to select lots of features and display them really fast ?

Jan 29, 2014 at 5:20 PM
I need to select lots of features in a polygon layer (about 500 of 2000 features in a shapefile). I select them by index and it works, but it took around 1 minutes to display the selection. How can I speed this up ?
layer = map1.AddLayer(@"C:\Users\royeral\Desktop\becancour\physitel\uhrh.shp") as DotSpatial.Controls.MapPolygonLayer;

...

// this simple loop take about 1 minutes 
for (int index = 0; index < 500; ++index)
    layer.Select(index);
Developer
Jan 30, 2014 at 5:33 AM
You can use overload Select(IEnumerable<int> featureIndices) method.
   var indecesToSelect = new List<int>(500);
                for (int i = 0; i < 500; i++)
                {
                    indecesToSelect.Add(i);
                }
                layer.Select(indecesToSelect);
Marked as answer by royeral on 1/30/2014 at 5:12 AM
Jan 30, 2014 at 12:14 PM
D'oh! I didn't look at the API carefully.