-1

I have path to layer or feature

C:\base.gdb\test

How to check is table or feature class by arcpy?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jul 30, 2014 at 9:56

2 Answers 2

4

You may use Describe Object property dataType:

desc = arcpy.Describe("C:/base.gdb/test")
if desc.dataType == 'FeatureClass':
 print 'fc'
elif desc.dataType == 'Table':
 print 'table'
else: print desc.dataType
answered Jul 30, 2014 at 11:46
-1

Use the arcpy.List... functions. First have to set the env.workspace to the fgdb. Then use arcpy.ListTables() or arcpy.ListFeatureclasses(). Each of these returns a python list of the requested type. If the list is empty (len(list) == 0), then there is no thing of that type. Unfortunately there does not seem to be a higher level function like arcpy.ListContents() or something.

answered Jul 30, 2014 at 11:55

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.