Is it possible to detect if a file geodatabase table/feature class is compressed or uncompressed using code (preferably C#)?
I got this from a colleague:
public static Boolean IsCompressed(IDataset dataset) { // Check the table's workspace type. IWorkspace workspace = dataset.Workspace; WorkspaceType workspaceType = GetWorkspaceType(workspace); if (workspaceType == WorkspaceType.FileGDB) { // Get the dataset's property set and check the "Datafile Format" property. IPropertySet propertySet = dataset.PropertySet; if (propertySet != null) { try { object propertyValue = propertySet.GetProperty("Datafile Format"); esriFGDBDatafileFormat datafileFormat = (esriFGDBDatafileFormat)propertyValue; if (datafileFormat == esriFGDBDatafileFormat.esriFGDBCompressedDatafile) { return true; } } catch (InvalidCastException) { } } } return false; }
He notes that FileGDB workspaces and feature datasets do not know if they are in a compressed file geodatabase, only tables and feature classes.
Nice, exactly what I needed. thanks!
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.