8

My answer to the question How to get size of file geodatabase feature class on disk? shows how one can enable a column in ArcCatalog showing the file size of FGDB feature classes in the contents view.

Does anyone know how ArcCatalog is able to calculate this, and is there a method or property exposed in ArcObjects or another API to determine this programmatically?

I had a look through the esriGeodatabase ArcObjects namespace and did not find anything relevant, nor in the file geodatabase API, but I may have missed something.

7
  • I don't think there's a way through the ArcGIS API, though I'm not sure about that. I've used native OS calls in the past to collect that information, though for a file GDB that could mean some extra coding to traverse the directory.
    – Lou
    Commented Apr 26, 2012 at 20:47
  • 4
    I think you'd need more than code to traverse the directory, you'd practically need to reverse engineer the spec! The files within the .gdb folder are binary encoded and while there are some plain text data if you look at them in hex, it's going to be a lot of hacking to make any sense of it.
    – blah238
    Commented Apr 26, 2012 at 21:04
  • 1
    Did you check to see if Size is exposed by IGxObjectProperties as a property? Commented Apr 27, 2012 at 1:43
  • Hey that worked! Turns out the property is called ESRI_GxObject_FileSize but appears to be in a weird unit of measure. A 1.01MB feature class in ArcCatalog for example is reported by the property as 105.6122, so ~10 KB units (myriabytes? WTH?).
    – blah238
    Commented Apr 27, 2012 at 3:03
  • Ahh, I bet they did that because in VB6/VBA the largest integer data type available was the Currency data type which was a 64-bit integer scaled by a factor of 10,000 and presumably whatever Windows API call they used internally to get the file size returned 8-byte (4-byte double word) integers. Apparently this was a common hack before .NET came out :)
    – blah238
    Commented Apr 27, 2012 at 4:37

1 Answer 1

5

AFAIK, the columns (like size) that appear in the right hand pane in ArcCatalog correspond to properties in IGxObjectProperties for the item selected in the treeview control in the left hand pane.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IGxObjectProperties_Interface/001400000159000000/

1
  • Curious how the actual names of the properties are not documented anywhere (as far as I could tell) outside of some obscure 9.x samples. Undocumented property sets are gross.
    – blah238
    Commented May 7, 2012 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.