Select to view content in your preferred language

ArcPy Layer Class dataType values

2695
1
11-09-2011 05:40 AM
AndrewRudin
Deactivated User
On the Arcpy.mapping.Layer class help, it explains that ArcMap layers have a dataType property that stores a layer's source 'Type' like Shapefile, or Geodatabase, or SDE, Raster, etc.  I would like to see a full list of possible values for this dataType property but can't seem to find it in the help.  Anyone know where it is?  http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Layer_properties/000v0000002t000000/

For now, I mainly need to know how to specifically identify layers who sources are shapefile, personal geodatabase, file geodatabase, or SDE, since I'll need to handle each of these categories in different ways.  Also need to identify if a standalone table in an MXD is dbf, personal geodatabase, file geodatabase, or SDE.  Would be nice to be able to do this without having to create some complex string search on the layers datasource.

Thanks for any help

-Andrew
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor
Andrew,

May be your solution is some combination of the describe object, more info here.

You could try using the dataElementType property?

This bit of python will give you all the data element types as long as they are not in a grouplayer.

mxd = arcpy.mapping.MapDocument("CURRENT")
l = arcpy.mapping.ListLayers(mxd)
for al in l:
 d = arcpy.Describe(al)
 print d.dataelementtype


Duncan
0 Kudos