This project is read-only.

FeatureSet IndexMode (need help)

Aug 4, 2011 at 2:50 AM

In DotSpatial.Data.FeatureSet there is a property 'IndexMode'. How does the DotSpatial engine decide, when to use index mode and when not to use it? From my testing, it looks like: Map.Layers.Add(fileName.shp) adds a layer with IndexMode==True.

Map.Layers.Add(new FeatureSet(FeatureType.Point)) adds a layer with IndexMode==False.

It also looks like Selection behaves differently depending on IndexMode. If IndexMode is true, then the progress handler is always updated when calling Select() method which slows down the application. Is there a way how I can control the IndexMode?

Can any of the more experienced developers explain to me the role of IndexMode? Is it similar to a Spatial Index?

Aug 4, 2011 at 2:52 PM

I don't have the complete answer, but I have a tidbit or 2.  It is not a spatial index.  It refers to index of the shape in the shapefile.  So, you could view it as a row number or record number.  The reason IndexMode is True in the first case is because the FeatureSet came from a shapefile.  In the latter case, there is no shapefile so there can be no indices.  HTH, Kyle

Aug 9, 2011 at 9:07 AM
kellison wrote:

I don't have the complete answer, but I have a tidbit or 2.  It is not a spatial index.  It refers to index of the shape in the shapefile.  So, you could view it as a row number or record number.  The reason IndexMode is True in the first case is because the FeatureSet came from a shapefile.  In the latter case, there is no shapefile so there can be no indices.  HTH, Kyle

Perhaps that explains map1.ResetBuffer() crashes when a feature is added to a featureset if the featureset is loaded from a shapefile.

Any solutions to fix it? Alex.