Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Path Names

$
0
0
Hi folks,

I need to get a list of path names for feature classes in a gdb. The gdb is configured something like this:

Myfeatures.gdb
Feature 1 Dataset
fc1, fc2,fc3
Feature 2 Dataset
fc1, fc2,fc3
Feature 3 Dataset
fc1, fc2,fc3
etc.

I am having trouble getting right down to the FC for a path. I tried using the os.path.join function but it doesn't seem to like lists and an input.

This is what I have so far for code.

Code:

import arcpy
import os
# Set the current workspace


gdbInput = "Q:\PIR\GIS\Brett\GDB Import Tool\Test Data\PIR_MR98copy.gdb"
gdbOutput = "Q:\PIR\GIS\Brett\GDB Import Tool\Test Data\EmptyGisDeliverables_v14.gdb"

arcpy.env.workspace = gdbInput

# Create list of datasets in input gdb
dsInput = arcpy.ListDatasets()
#print dsInput

#Create list of fc in ds
for ds in dsInput:
    fcInput = arcpy.ListFeatureClasses(feature_dataset=ds)
    print fcInput

This is what I get for results from previous code:
Code:

[u'AppraisalPoint']
[u'BlockHubs', u'BlockPolygon']
[u'RoadLine', u'RoadCrossing', u'RoadNotes', u'RoadHubs']
[u'RiparianLine', u'Riparian_SMZ_Buffer', u'LakeWetland', u'LakeWetlandLine']

Thanks.

Brett

Viewing all articles
Browse latest Browse all 2485

Trending Articles