AnsweredAssumed Answered

Write Name and Geometry Type of Feature Classes in an Enterprise Geodatabase Connection

Question asked by jayanta.poddar Champion on Oct 27, 2017
Latest reply on Oct 27, 2017 by jayanta.poddar

Hi Guys,

 

I need a script which would write the name and geometry (Point,Line,Polygon) of the Feature Classes from an Ent. GDB to a CSV file.

So far, I am able to write the names successfully using the below script. 

import arcpy 
from arcpy import env
import os

# Set the workspace for the ListFeatureClass function

from arcpy import env
import os

# Set the workspace for the ListFeatureClass function
env.workspace = r"Path\xyz.sde"
# Use the ListFeatureClasses function to return a list of all fc's in the sde gdb:
fcList = arcpy.ListFeatureClasses()

# Write the name of the current fc in csv file:
txtFile = open(r"Path\xyz.csv","w")
for fc in fcList:
    print fc

    # Write messages to a csv File
    txtFile.write(fc)
    txtFile.write (os.linesep)

#close csv file
txtFile.close()

print "done"

How do I write the Geometry Type?

Also suggestions are welcome to further optimize the above script.

 

 

Thanks!!!

Outcomes