<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: da.walk can't get featureclasses in featuredataset? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324153#M68502</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Each feature dataset is considered its own environment by arcpy, so functions like Walk() and ListFeatureClasses() will ignore stuff in a feature dataset if run on a geodatabase.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not quite right for Walk.&amp;nbsp; You just need to keep iterating through the Walk results.&amp;nbsp; Any feature datasets are considered workspaces, so Walk will recurse to them and return their contents.&lt;/P&gt;</description>
    <pubDate>Wed, 30 Aug 2023 21:52:07 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2023-08-30T21:52:07Z</dc:date>
    <item>
      <title>da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1323803#M68493</link>
      <description>&lt;P&gt;Can arcpy.da.Walk() function find featureclasses within a featuredataset in gdb?&amp;nbsp; For example, there&amp;nbsp; are a featuredataset 'DT' and a featureclass 'A' in gdb, and a featureclass 'B' in 'DT', after walk(gdb), it can only find DT and A, but no B.&amp;nbsp; Is it normal ?&lt;/P&gt;&lt;P&gt;I use 10.8.2.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 09:32:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1323803#M68493</guid>
      <dc:creator>pyfans</dc:creator>
      <dc:date>2023-08-30T09:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1323856#M68494</link>
      <description>&lt;P&gt;Each feature dataset is considered its own environment by arcpy, so functions like Walk() and ListFeatureClasses() will ignore stuff in a feature dataset if run on a geodatabase.&lt;/P&gt;&lt;P&gt;What you have to do instead is iterate through what's returned by Walk, check if it's a featuredataset, then change the environment to the featuredataset and list those feature classes in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's some sample code I wrote. In this case, "fd" was originally the output of arcpy.ListFeatureDatasets(), but you could sub in the files from Walk()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dirP = #whatever gdb you were running Walk() on
desc= (arcpy.da.Describe(fd))
if 'datasetType' in desc:
    if desc['datasetType'] == "FeatureDataset":
        arcpy.env.workspace = os.path.join(dirP, fd)
        fdFCList = arcpy.ListFeatureClasses()
        if fdFCList:
           for fc in fdFCList:
                fList.append([os.path.join(
                             desc['catalogPath'],fc)])

        # Reset the workspace or else this breaks.
        arcpy.env.workspace = dirP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 12:32:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1323856#M68494</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-08-30T12:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324150#M68501</link>
      <description>&lt;P&gt;Works for me in ArcMap 10.8.2.&amp;nbsp; Given a FGDB with 2 FCs, "A" and "B" with "B" in feature dataset "FD":&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Luke_Pinner_0-1693431703274.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79517iB1173CE3494517F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Luke_Pinner_0-1693431703274.png" alt="Luke_Pinner_0-1693431703274.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import arcpy

for parent, workspaces, datasets in arcpy.da.Walk("Default.gdb"):
    print("parent: %s"%parent)
    print("workspaces: %s"%workspaces)
    print("datasets: %s"%datasets)&lt;/LI-CODE&gt;&lt;P&gt;Output showing that "B" is listed correctly in the feature dataset "FD":&lt;/P&gt;&lt;LI-CODE lang="markdown"&gt;parent: Default.gdb
workspaces: [u'FD']
datasets: [u'A']
parent: Default.gdb\FD
workspaces: []
datasets: [u'B']&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 21:45:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324150#M68501</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2023-08-30T21:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324153#M68502</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/458875"&gt;@AlfredBaldenweck&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Each feature dataset is considered its own environment by arcpy, so functions like Walk() and ListFeatureClasses() will ignore stuff in a feature dataset if run on a geodatabase.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Not quite right for Walk.&amp;nbsp; You just need to keep iterating through the Walk results.&amp;nbsp; Any feature datasets are considered workspaces, so Walk will recurse to them and return their contents.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 21:52:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324153#M68502</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2023-08-30T21:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324189#M68503</link>
      <description>&lt;P&gt;Yes, after try again, I find it works when there are no any non-english (or say non-ascii?) character in gdb, but if there are Chinese character in gdb or featuredataset or featureclass's name, it just can't get featureclasses in featuredataset.&lt;/P&gt;&lt;P&gt;I tried 10.8.2 and 10.4.1.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 01:11:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324189#M68503</guid>
      <dc:creator>pyfans</dc:creator>
      <dc:date>2023-08-31T01:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324206#M68504</link>
      <description>&lt;P&gt;I think feature class names need to use ascii characters only. From the &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/manage-data/geodatabases/defining-feature-class-properties.htm" target="_self"&gt;help:&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Luke_Pinner_0-1693455792006.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/79532i911B78D4DFC39D73/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Luke_Pinner_0-1693455792006.png" alt="Luke_Pinner_0-1693455792006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 04:24:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324206#M68504</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2023-08-31T04:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: da.walk can't get featureclasses in featuredataset?</title>
      <link>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324309#M68506</link>
      <description>&lt;P&gt;Good to know, thanks for the clarification.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I avoid Walk because it &lt;A href="https://community.esri.com/t5/python-questions/arcpy-da-walk-read-kmls-personal-gdbs-etc/m-p/1295820" target="_blank" rel="noopener"&gt;doesn't do&lt;/A&gt; quite what I &lt;A href="https://community.esri.com/t5/python-ideas/functio-to-list-non-gis-files/idi-p/1296377" target="_blank" rel="noopener"&gt;want it to do&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 13:09:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-walk-can-t-get-featureclasses-in-featuredataset/m-p/1324309#M68506</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2023-08-31T13:09:36Z</dc:date>
    </item>
  </channel>
</rss>

