<?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: Comparing Feature Classes in two different geodatabases in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197250#M15123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"The teacher is no longer merely the-one-who-teaches, but one who is himself taught in dialogue with the students, who in turn while being taught also teach. They become jointly responsible for a process in which all grow." -Paulo Freire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2011 21:43:02 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2011-06-22T21:43:02Z</dc:date>
    <item>
      <title>Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197243#M15116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This forum has been a great help to me in creating a couple python tools I really needed to get working. So thanks a ton to the people who have helped me with these. I 'm hoping I can get help with one last tool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a master database with a master set of feature classes in it and a new database with most of the same feature classes and a couple new ones. Is there python code I can use to print out a list of just the feature classes names in the new database that don't match any of the feature class names in the master database? Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Phil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 12:38:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197243#M15116</guid>
      <dc:creator>philiptivel</dc:creator>
      <dc:date>2011-06-22T12:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197244#M15117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did something similar, looks like this. Counting features in a feature class and making sure they have the same number of features as another feature class. You could just modify it so it just tests whether it is there is or isn't a feature class of that name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would be a simple like like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if fc2 not in fcList:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; print fc2+" not found"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

sde1 = r"D:\sde_transit\sde1.gdb"
output = r"C:\Users\coylema\AppData\Roaming\ESRI\Desktop10.0\ArcCatalog\Connection to winms-wooddb.sde"
#output = r"D:\sde_transit\sdeCSRS.gdb"

arcpy.env.workspace = r"D:\sde_transit\sde1.gdb"

sdeList = arcpy.ListFeatureClasses()
for fc in sdeList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.GetCount_management(fc)
&amp;nbsp;&amp;nbsp;&amp;nbsp; count1 = result.getOutput(0)

&amp;nbsp;&amp;nbsp;&amp;nbsp; fc2 = output+"\\TFM_BKG."+fc
&amp;nbsp;&amp;nbsp;&amp;nbsp; if arcpy.Exists(fc2):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = arcpy.GetCount_management(fc2)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; count2 = result.getOutput(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if count1 == count2:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc+" OK"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Problem with "+fc
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print count1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print count2
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print fc2+" not found"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass

# Clean up
sdeList = None
del arcpy.env.workspace
del arcpy
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197244#M15117</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T09:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197245#M15118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the help it definitely got me a lot closer. I decided that instead of printing out a list of the new feature classes in my dataset, that instead I would simply delete out any feature classes that matched those in the master dataset, thus leaving me with only the new feature classes that don't appear in the master dataset. My code runs successfully but it's not doing anything and I'm not sure why. Here is how I wrote it&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy

MasterDataset = arcpy.GetParameterAsText (0)
fcs = arcpy.GetParameterAsText (1)

arcpy.env.workspace = MasterDataset

fclist = arcpy.ListFeatureClasses()

for fc in fcs:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if fc in fclist:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(fc, "FeatureClass")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:51:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197245#M15118</guid>
      <dc:creator>philiptivel</dc:creator>
      <dc:date>2021-12-11T09:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197246#M15119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What exactly is MasterDataset, and what is fcs?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, why do you limit your deletes to Feature Class only? Are there tables etc with similar names you want to keep? Feature Class should also be two words iirc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 16:13:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197246#M15119</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-06-22T16:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197247#M15120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Both MasterDataset and fcs are datasets that users gets to input for the purpose of comparing the feature classes inside them. Any feature classes that are in the fcs dataset that are not in the MasterDataset dataset need to be evaluated. That's why I would like to delete all the feature classes in the fcs dataset that are already in the MasterDataset dataset.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess I don't need to limit the deletes to feature classes only, but there are no other tables or anything that appear in these datasets or databases. I input the delete tool in model builder and converted it to python and it left the "FeatureClass" in the Delete_management statement so I did too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 16:35:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197247#M15120</guid>
      <dc:creator>philiptivel</dc:creator>
      <dc:date>2011-06-22T16:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197248#M15121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, you will want to make a list of both datasets first, from your input workspaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy

MasterDataset = arcpy.GetParameterAsText (0)
fcs = arcpy.GetParameterAsText (1)

arcpy.env.workspace = MasterDataset
fclist = arcpy.ListFeatureClasses()
arcpy.env.workspace = fcs
fcslist = arcpy.ListFeatureClasses()

for fc in fcslist:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if fc in fclist:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Delete_management(fc)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197248#M15121</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T09:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197249#M15122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That worked perfectly! Thanks so much for your help!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 21:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197249#M15122</guid>
      <dc:creator>philiptivel</dc:creator>
      <dc:date>2011-06-22T21:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Feature Classes in two different geodatabases</title>
      <link>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197250#M15123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"The teacher is no longer merely the-one-who-teaches, but one who is himself taught in dialogue with the students, who in turn while being taught also teach. They become jointly responsible for a process in which all grow." -Paulo Freire&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 21:43:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-feature-classes-in-two-different/m-p/197250#M15123</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-06-22T21:43:02Z</dc:date>
    </item>
  </channel>
</rss>

