<?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: Discover if a workspace is a geodatabase or a feature dataset in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38808#M3046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;...think you can use Describe for this.&amp;nbsp; The datasetType property should return a string, FeatureDataset or FeatureClass, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the sample code here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000002n000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000002n000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Oct 2012 03:35:25 GMT</pubDate>
    <dc:creator>T__WayneWhitley</dc:creator>
    <dc:date>2012-10-25T03:35:25Z</dc:date>
    <item>
      <title>Discover if a workspace is a geodatabase or a feature dataset</title>
      <link>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38807#M3045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How can I discover if the os.path.dirname of a feature class is a feature dataset or a geodatabase?&amp;nbsp; I need to generate a stand-alone frequency table of values from the feature class, but I can only create that stand-alone table at the geodatabase level, not at the feature dataset level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 03:19:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38807#M3045</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2012-10-25T03:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Discover if a workspace is a geodatabase or a feature dataset</title>
      <link>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38808#M3046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;...think you can use Describe for this.&amp;nbsp; The datasetType property should return a string, FeatureDataset or FeatureClass, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the sample code here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000002n000000"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000002n000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 03:35:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38808#M3046</guid>
      <dc:creator>T__WayneWhitley</dc:creator>
      <dc:date>2012-10-25T03:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Discover if a workspace is a geodatabase or a feature dataset</title>
      <link>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38809#M3047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Carl,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're iterating through feature classes within a geodatabase, it will only return stand-alone feature classes unless you specify a feature dataset within the arcpy.ListFeatureClasses function.&amp;nbsp; Ex:&amp;nbsp; (will only return stand-alon feature classes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;lstFCs = arcpy.ListFeatureClasses("*") for fc in lstFCs: &amp;nbsp;&amp;nbsp;&amp;nbsp; print fc&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're not iterating using the arcpy.ListFeatureClasses function, you can use the describe method that Wayne mentioned.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;dir = os.path.dirname(env.workspace + os.sep + fc) desc = arcpy.Describe(dir) if desc.dataType == "Workspace": &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;remaining code&amp;gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 11:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38809#M3047</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-10-25T11:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Discover if a workspace is a geodatabase or a feature dataset</title>
      <link>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38810#M3048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, another rookie mistake on my part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd been using the datasetType property without success, but the dataType property of os.path.dirname(feature class) distinguishes between a Folder, a Geodatabase, and a Feature dataset...which is what I needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks to Wayne and Jake for nudging my pea-brain in the right direction...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Oct 2012 16:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/discover-if-a-workspace-is-a-geodatabase-or-a/m-p/38810#M3048</guid>
      <dc:creator>CarlBeyerhelm</dc:creator>
      <dc:date>2012-10-25T16:47:22Z</dc:date>
    </item>
  </channel>
</rss>

