Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

We're migrating some feature classes from SDELOB (or some older binary format) to ST_Geometry. As we write our arcpy script to use the ESRI Migrate Storage Tool we'd like to test whether or not something already is ST_Geom...Other than writing hooks into the database, using the comtypes package etc., does anyone know of a simple way to determine this?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

To follow-up on PolyGeo's answer, the Describe object is certainly where it should be, but it isn't. Database queries may be the best way to go here.

Although, if you have the SDE command-line binaries, another option would be to try doing something like this (yes it's a hack, but might work):

import subprocess
output = subprocess.check_output("sdelayer -o describe_long -s servername -D dbname -u username -p password -l tablename,columname")
for line in output:
    if line.find("Layer Type") == 0:
        storagetype = line.partition(":")[2].strip() # Should be something like "SDE-BINARY" or "Extended SQL Type/ST_GEOMETRY"
share|improve this answer
add comment

It would be good if the Describe object were able to access this.

This has now been submitted as an ArcGIS Idea (on which you can vote).

share|improve this answer
1  
I meant to add this as a Comment rather than an Answer. In any event, I think it could be the subject of a useful ArcGIS Idea for ArcPy. –  PolyGeo Feb 28 '12 at 2:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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