Skip to main content
Solved

FGDB Feature Class file size

  • August 19, 2025
  • 6 replies
  • 89 views

jtr_atx
Contributor
Forum|alt.badge.img+1

I am attempting to find the file sizes for each Feature Class within a FGDB, both within a Feature Dataset and at the root of the FGDB.  All research yields that the file size is not available via the PythonCaller and we are trying to isolate the FC filesize output via:

PythonCaller > getFeatureClassSize

import os
 
def getFeatureClassSize(feature):
    fc_path = feature.getAttribute("FC_path")
    total_size = 0
 
    # Common file extensions in a File Geodatabase
    valid_extensions = {'.gdbtable', '.gdbtablx', '.atx', '.spx', '.freelist', '.gbx', '.cat', '.gdbindexes'}
 
    if os.path.exists(fc_path):
        if os.path.isfile(fc_path):
            ext = os.path.splitext(fc_path)[1].lower()
            if ext in valid_extensions:
                total_size = os.path.getsize(fc_path)
        else:
            for dirpath, dirnames, filenames in os.walk(fc_path):
                for f in filenames:
                    ext = os.path.splitext(f)[1].lower()
                    if ext in valid_extensions:
                        fp = os.path.join(dirpath, f)
                        if os.path.exists(fp):
                            total_size += os.path.getsize(fp)
 
    # Store formatted size in MB
    size_mb = round(total_size / (1024 * 1024), 2)
    feature.setAttribute("FC_Size_MB", size_mb)
 
    return feature

The values for Size yields 0.

Any help or guidance would be greatly appreciated.

 

Best answer by hkingsbury

Thank you for the response - I am attempting to calculate the file size for a specific Feature Class (feature type) within the File Geodatabase.



From a quick look online, It doesn’t seem like this will be possible without building an AddIn for Pro - https://community.esri.com/t5/arcgis-pro-sdk-questions/get-feature-class-raster-file-size-in-file/td-p/1316153

 

What is the purpose/driver for wanting to know the size of each feature class?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+47

Are you trying to determine the size of the whole file geodatabase? or just a specific feature type within the file goedtabase?

Are you just trying to caculate all the file sizes for a given rootname? e.g., a0000000a.gdbtable, a0000000a.gdbtablx and a0000000a.spx

I think this should also be able to be done with a Path reader and a statistics calculator grouping by path_rootname. 

 


jtr_atx
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 26, 2025

Thank you for the response - I am attempting to calculate the file size for a specific Feature Class (feature type) within the File Geodatabase.


hkingsbury
Celebrity
Forum|alt.badge.img+64
  • Celebrity
  • Best Answer
  • August 26, 2025

Thank you for the response - I am attempting to calculate the file size for a specific Feature Class (feature type) within the File Geodatabase.



From a quick look online, It doesn’t seem like this will be possible without building an AddIn for Pro - https://community.esri.com/t5/arcgis-pro-sdk-questions/get-feature-class-raster-file-size-in-file/td-p/1316153

 

What is the purpose/driver for wanting to know the size of each feature class?


jtr_atx
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • August 26, 2025

Understood.

We are undertaking a multi-TB / multi-network drive / agency-wide GIS data housekeeping effort to migrate data into Enterprise and subsequent network drive cleanup.  We are attempting to collect an as-is state for this effort and feature class size is one of the parameters that would be helpful for our assessment.


hkingsbury
Celebrity
Forum|alt.badge.img+64
  • Celebrity
  • August 26, 2025

For vector data, a feature count per featureclass is probably a sufficient metric on volume, you could combine this with vertex count per feature to give a proxy on size


jtr_atx
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • September 2, 2025

jkingsbury - thank you