<?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 Comparing fields from two Feature Classes. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/comparing-fields-from-two-feature-classes/m-p/606276#M47390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, and thank you for taking your time to look at my post.&amp;nbsp; I am new to Python(I was in a class at this time a week ago).&amp;nbsp; I am looking for a Python function(?) to compare a field in two seperate feature classes.&amp;nbsp; arcpy.SelectLayerByAttribute_management looks close to what I am looking for, but I do not think it will work for my use.&amp;nbsp; I cannot join the layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my scenario.&amp;nbsp; I have an address feature class and street feature class, the address feature class has a field that is tied to the street the address is located.&amp;nbsp; So all addresses on Main St. have a StreetID field, the number in the StreetID field should match the ID field of Main St. in the Street feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to create a new layer/feature class of the Addresses where the StreetID in Addresses does not match the ID of the street in Streets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In VB.net I had it looping through the streets, searching the addresses that matched the street name (street, city, state, zip) and then comparing the StreetID - ID fields, writing errors to a selection set then creating the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my brief experience with arcpy I would think there is a funtion that allow me to do that.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not looking for code, just wanting to find out if there is a function I can work with.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Dale&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jun 2014 13:35:13 GMT</pubDate>
    <dc:creator>DaleShearer</dc:creator>
    <dc:date>2014-06-06T13:35:13Z</dc:date>
    <item>
      <title>Comparing fields from two Feature Classes.</title>
      <link>https://community.esri.com/t5/python-questions/comparing-fields-from-two-feature-classes/m-p/606276#M47390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, and thank you for taking your time to look at my post.&amp;nbsp; I am new to Python(I was in a class at this time a week ago).&amp;nbsp; I am looking for a Python function(?) to compare a field in two seperate feature classes.&amp;nbsp; arcpy.SelectLayerByAttribute_management looks close to what I am looking for, but I do not think it will work for my use.&amp;nbsp; I cannot join the layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my scenario.&amp;nbsp; I have an address feature class and street feature class, the address feature class has a field that is tied to the street the address is located.&amp;nbsp; So all addresses on Main St. have a StreetID field, the number in the StreetID field should match the ID field of Main St. in the Street feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to create a new layer/feature class of the Addresses where the StreetID in Addresses does not match the ID of the street in Streets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In VB.net I had it looping through the streets, searching the addresses that matched the street name (street, city, state, zip) and then comparing the StreetID - ID fields, writing errors to a selection set then creating the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my brief experience with arcpy I would think there is a funtion that allow me to do that.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not looking for code, just wanting to find out if there is a function I can work with.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Dale&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 13:35:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-fields-from-two-feature-classes/m-p/606276#M47390</guid>
      <dc:creator>DaleShearer</dc:creator>
      <dc:date>2014-06-06T13:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields from two Feature Classes.</title>
      <link>https://community.esri.com/t5/python-questions/comparing-fields-from-two-feature-classes/m-p/606277#M47391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Why can't you join the layers? It does seem a bit of a lost cause if you can't at least do that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However some joins may be very inefficient if there is no index and you do not have permission to build it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Copy the data so that you can, or extract the data to enable the comparision.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't think 'loop through' if at all possible, use SQL type queries on whole tables for efficiency.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If the data is small enough to fit into memory there are Python structures to make comparisons fast.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example you could use a cursor to read in the fields from each table into a list and a dictionary and run a set comparision to get a list of differences. If that is small compared to the total, then there is a huge benefit.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Jun 2014 20:50:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/comparing-fields-from-two-feature-classes/m-p/606277#M47391</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2014-06-08T20:50:24Z</dc:date>
    </item>
  </channel>
</rss>

