You can use the arcpy.ListFeatureClasses to accomplish this there is a type option. Documentation below
http://resources.arcgis.com/en/help/main/10.1%20/index.html#//002z00000011000000
I'm assuming your question is vague for a reason and not poorly written. There are going to have to be some assumptions on my end and the answer can only be psuedo code, because you have not stated what the file types meet your criteria for conversion, and if there are multiple data types. If there are you will have to expand this answer with if/else
clause in order to ultimately perform Do something
or provide your script in the OP. The da.walk
method is a hybrid of os.walk
and includes a data type.
I think this may be a misunderstanding of what a feature classes
is. A more detailed discussion on the topic can be found here on another thread but the basics:
The definition of feature class is a "homogeneous collections of common features, each having the same spatial representation, such as points, lines, or polygons, and a common set of attribute columns, for example, a line feature class for representing road centerlines."
Feature classes are stored in a container be it a shapefile, DWG, or DB. For high level thinking a shapefile can be thought of as a single feature class while a gdb is many features classes. You script is going to have to target the container that holds the feature class
(shapefile or some other container it does not matter) and perform the action on the contents. You can use arcpy.da.Walk
to target those containers that meet a certain datatype
criteria (provided its an ESRI compatible container).
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace,
topdown=True,
datatype="featureclass"):
for filename in filenames:
arrcpy.whatever()
Another Example:
As per the ESRI documentation you can query based on dataypes
and filetype
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace,
datatype='FeatureClass', type=['Polygon', 'Polyline']):
Here is an example of using da.walk
on a data tree
'''
Created on Aug 25, 2014
@author: PeterW
'''
# Import system modules
import arcpy
import os
# Set current workspace
workspace = r'E:\Projects\Projects14\H103342\test2.gdb'
arcpy.env.workspace = workspace
# Set environment settings
arcpy.env.overwriteOutput = True
# Create list of Feature Classes in each Feature Dataset
fcs = []
# Iterate through each Feature Dataset within the File Geodatabase
for dirpath, dirnames, filenames in arcpy.da.Walk(workspace, datatype = "FeatureDataset"):
for filename in filenames:
print filename
try except else
clause.