I'm trying to GetAllFeatures from a given FeatureLayer, but I don't want to load it all into memory first. Ideally I need some sort stepping through each Feature without first loading them in. Anyone know of a way for me to do this?
Lets say I have a Shape file with 200,000 rows. I want to grab the first 10,000, run them through a method and inject them into a SQL database, then repeat this process for the next 10,000.
Currently i'm using FeatureLayer.GetAllFeatures(ReturningColumnsType.AllColumns) but my application throws an out of memory exception on large datasets.
After thinking about the problem further... Is there a way to grab a list of all ID's in the FeatureLayer/FeatureSource and use that list later to query the source in bite sized chunks?
- Open the FeatureSource
- *Grab all feature ID's (new method?)
- Grab first 10,000 features and associated attribute columns based on the ID's and GetFeaturesByIds(ids)
All three stages would be fast (and manageable), and would suit me quite well. Although stepping through each feature 1 at a time would be better.