Enhance Describe to enable ArcPy to determine SDE storage type (ST_GEOMETRY, etc)

1331
5
06-12-2012 06:52 PM
Status: Already Offered
Labels (3)
GraemeBrowning
Occasional Contributor III
From ArcPy I would like to be able to determine the storage type (ST_GEOMETRY, SDO_GEOMETRY, SDEBINARY) of data stored in relational databases via ArcSDE in order to either report on how spatial data is stored, or to determine what operations it is likely to support.

This has also been discussed at Stack Exchange GIS.
5 Comments
ChristinaKellum
I am in the process of migrating storage, I'm kinda shocked that this is not part of the Describe Object.  I am migrating 36 datasets,  some are failing in the process and then I need to go into ArcCatalog and indivdually click on each feature class to see what has been migrated.  This is kinda silly.  Please add the Geometry Storage Type to a property of the feature class.  Thanks!
IngmarAlbinson
Python example for this workaround, note placement of database connection file

# -*- coding: utf-8 -*-

import arcpy, subprocess, sys, codecs, os
reload(sys) # See stackoverflow question 2276200
sys.setdefaultencoding('utf-8')

os.chdir("C:\\Program Files\\ArcGIS\\ArcSDE\\commands\\bin")
arcpy.env.workspace = r'P:\\Database\\Connection_to_Database.sde'
password = u"Type_Your_PassWord"

desc = arcpy.Describe(arcpy.env.workspace)

# Print Connection properties

cp = desc.connectionProperties
server = cp.server
instance = cp.instance
database = cp.database
user = cp.user
version = cp.version

print "\nDatabase Connection Properties:"
print "% -12s %s" % ("  Server:", server)
print "% -12s %s" % ("  Instance:", instance)
print "% -12s %s" % ("  Database:", database)
print "% -12s %s" % ("  User:", user)
print "% -12s %s" % ("  Version:", version)
print

# Get a list of data sets and feature class
datasetList = arcpy.ListDatasets()
datasetList.sort()
datasetList.append("")

for dataset in datasetList:
    print(dataset.encode('cp1252'))

    fcList = arcpy.ListFeatureClasses("*", "All", dataset)
    fcList.sort()

    # Loop through the list
    for fc in fcList:
        if dataset == "":
            print(" "),
        else:
            print('   '),
        print(fc.encode('cp1252')),

        sdelayer = u"sdelayer -o describe_long -l " + fc + ",shape -D " + database + " -i " + instance + " -u " + user + " -p " + password
        output = subprocess.check_output(sdelayer.encode('cp1252'))
        Layer_Type = output.partition("Layer Type")[2].strip()
        Layer_Type = Layer_Type.partition(":")[2].strip()
        Layer_Type = Layer_Type.partition("Creation Date")[0].strip()
        print(Layer_Type)

print('\nPress Enter to continue ...')
raw_input()
 
AJR
by

The ArcGIS Pro arcpy describe object contains a geometryStorage method for GDB Feature classes that isn't available on the "regular" arcpy describe object.  This is a very handy attribute it should be added to the regular arcpy describe method return attributes.

PaulDavidson1

I believe this is a duplicate of:

Enhance arcpy.Describe(obj) to show geometryStorage

SSWoodward
Status changed to: Already Offered

Although this is an old idea, we'd like to draw attention to some documentation that will help users if they find themselves in this thread.

Users are now able to use ArcPy to determine the storage engine type using arcpy.Describe().  I've included a link to the most recent doc for the Describe function, as well as a technical article for additional clarification if needed.  

Describe Function:

https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/gdb-featureclass-properties.htm

ESRI Technical Article: How to report geometry storage type used for all spatial data in an Enterprise Geodatabase using Python.

https://support.esri.com/en/technical-article/000026361

Thanks for the Ideas!