Vishful thinking…

Bulk loading data into ESRI FeatureClasses

Posted in Uncategorized by viswaug on October 12, 2007

Yesterday, I was talking to a developer who was writing import scripts to load data from his legacy databases into ArcSDE FeatureClasses. Half way into our discussion, I realized that he wasn’t taking advantage of the IFeatureClassLoad interface in ArcObjects which speeds up the importing of data into the ArcSDE by magnitudes. It achieves it performance boost by suspending updates to the spatial index after every feature is added to FeatureClass and by updating the spatial index only after the FeatureClass is taken out of the load-only mode.

To quote ESRI’s documentation

IFeatureClassLoad is an optional interface supported by feature classes in ArcSDE and feature classes and tables in File Geodatabase. It improves performance of data loading.

With ArcSDE, putting a feature class in load-only mode disables updating of the spatial index while data is loading. In a File Geodatabase, putting a feature class or table in load-only mode disables updating of spatial and attribute indexes while data is loading. Taking the feature class or table out of load-only mode rebuilds the indexes.

While a feature class or table is in load-only mode, other applications cannot work with the data. A feature class or table should be placed in load-only mode only after acquiring an exclusive schema lock on the feature class via the ISchemaLock interface.

The dataset extent reported by the IGeoDataset::Extent property is recalculated when a feature class is removed from LoadOnlyMode to reflect the data present in the feature class.

Dig into this code sample here for more details on using IFeatureClassLoad. And if you end up locking up your FeatureClass while using IFeatureClassLoad, use the ‘sdetable‘ with the ‘-o normal_io‘ option to get yourself out of trouble.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: