Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to develop an arcpy script which will eventually loop through number of rasters and feature classes stored in file geodatabase. I'd like to export spatial reference for these attributes along with their name to csv. I managed to do that for raster datasets, however I'm struggling with feature classes.

All rasters are stored directly in geodatabase so I have no problem with referencing these. All feature classess are stored within 3 feature datasets. In order to reference these FCs I set env.workspace pointing to relevant Feature Dataset, which works fine. I'd like to find the way to reference all of my Fcs at once, something like:

fcList = arcpy.ListFeatureClasses("*", "polygon", ***InFeatureDatasets***)
outFilePTH = r'...\output.csv'
share|improve this question

You could get a list of the featuredatasets using the ListDatasets function, then loop through that list to get at the featureclasses within each featuredataset. From the docs:

datasetList = arcpy.ListDatasets("C*", "Feature")

for dataset in datasetList:
    print dataset
share|improve this answer

Your Answer


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.