<?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 How to use Arcpy to access feature classes outside of feature datasets in an sde connection? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-access-feature-classes-outside/m-p/434875#M34191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm finding that python is crashing each time I request feature classes using ArcPy when the default workspace is set to an sde connection. I have feature classes that are not within feature datasets. Currently, the only way that I am able to access these feature classes outside of the feature datasets is by using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;for root, dirs, datasets in arcpy.da.Walk(workspace):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for ds in datasets:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(os.path.join(root, ds))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;However, this returns every item in the sde which is far more than I need and when I put a datatype filter in the Walk method it crashes the program (i.e.&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; datatype = 'FeatureClass'&lt;/SPAN&gt;). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;ArcPy also crashes when I run &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;arcpy.ListFeatureClasses()&lt;/SPAN&gt;&amp;nbsp;with&amp;nbsp;the sde workspace set to default.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Am I missing something obvious?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Any insight would be really appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Dec 2019 23:28:13 GMT</pubDate>
    <dc:creator>AndrewCampbell2</dc:creator>
    <dc:date>2019-12-09T23:28:13Z</dc:date>
    <item>
      <title>How to use Arcpy to access feature classes outside of feature datasets in an sde connection?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-access-feature-classes-outside/m-p/434875#M34191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm finding that python is crashing each time I request feature classes using ArcPy when the default workspace is set to an sde connection. I have feature classes that are not within feature datasets. Currently, the only way that I am able to access these feature classes outside of the feature datasets is by using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;for root, dirs, datasets in arcpy.da.Walk(workspace):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for ds in datasets:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print(os.path.join(root, ds))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;However, this returns every item in the sde which is far more than I need and when I put a datatype filter in the Walk method it crashes the program (i.e.&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt; datatype = 'FeatureClass'&lt;/SPAN&gt;). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;ArcPy also crashes when I run &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;arcpy.ListFeatureClasses()&lt;/SPAN&gt;&amp;nbsp;with&amp;nbsp;the sde workspace set to default.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Am I missing something obvious?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Any insight would be really appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Thanks&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2019 23:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-access-feature-classes-outside/m-p/434875#M34191</guid>
      <dc:creator>AndrewCampbell2</dc:creator>
      <dc:date>2019-12-09T23:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Arcpy to access feature classes outside of feature datasets in an sde connection?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-access-feature-classes-outside/m-p/1094349#M62221</link>
      <description>&lt;P&gt;Was this ever resolved? I am having the same exact issue now and I am clueless as to why? I have two scripts, it works fine in one and crashes in the other. Makes no sense! Can&amp;nbsp;@esri help?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Sep 2021 14:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-use-arcpy-to-access-feature-classes-outside/m-p/1094349#M62221</guid>
      <dc:creator>awd</dc:creator>
      <dc:date>2021-09-01T14:34:13Z</dc:date>
    </item>
  </channel>
</rss>

