Finding out if a File Geodatabase Feature Class is compressed

Compressed file geodatabases (fGDB) are a great thing. They render data amazingly fast and search quickly but take up a miniscule amount of disk space. Good job to ESRI on getting it right.

They are not editable though, and therefore need to be removed from any candidate editable feature classes you may be looking at.

The following piece of code can be used to determine if the ftrClass is editable:

ICompressionInfo info = featureClass.FullName as ICompressionInfo;
if (info != null)
{
    if (info.IsCompressed == true)
        return true;
}
This also handles when you are dealing with a feature class that is not from a fGDB as it will not implement ICompressionInfo.
 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>