In one of my arcobjects-based GIS tools I have a process which takes an array of shapefile paths and uses them as inputs with the ESRI.ArcGIS.DataManagement.Merge tool. I run it via a Geoprocessor instance. I use this setup for various other gp tasks (such as Get Count and Calculate Field), but I have found that a Merge process takes a much longer period to process than if I had run it in ArcMap or ArcCatalog. For example, a process which I have clocked at around 3 hours took over 27 to complete when performed with this method in ArcObjects.
Has anyone experienced this before, and are there any known methods for expediting the process?
To be more explicit about the workflow taking place here:
- Create a backgroundworker object to do this in a separate thread to avoid UI lockup.
- List shapefile paths using Directory.GetFiles and append them to a semicolon-delimited path string for the merge operation
- Perform a Get Count on each Shapefile
- Use the path string to perform a merge operation.
I've tried using
Geoprocessor to see if there is any noticeable increase in performance, but to no avail. There are no tight loops involved (unless you consider rapid-fire Get Counts), and I certainly have no use for an EditSession. For some reason, however, the process just plods along at an amazingly slow pace.
It is worth noting that I am working with unreasonably large data sets (the road network of North America, for example), so I doubt any method that makes use of RAM as a workspace will be appropriate.