<?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: update field records in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-field-records/m-p/603726#M47173</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Below is an example on how I was able to accomplish this.&amp;nbsp; The OBJECTIDs for the two feature classes were the same, so I first appended all the new features created for a polygon split.&amp;nbsp; Then I compare the original geometry to each geometry in the subset feature class (excluding new features).&amp;nbsp; If the geometry is different, I delete the original feature and update with the new feature (the other half of the geometry that was created from the polygon split).&amp;nbsp; Since I used the OBJECTID I can only run this script once as the OBJECTIDs in the original feature class will change after the appends.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"
env.overwriteOutput = True

fcA = "AirportsA"
fcB = "AirportsB"

OID_list = []
listB = []

# find max OBJECTID
rows = arcpy.SearchCursor(fcA)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; OID_list.append(row.OBJECTID)

del row, rows

maxOID = sorted(OID_list)[-1]

# append all geometries for AirportsB to list
rows = arcpy.SearchCursor(fcB)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; listB.append(geom.area)

del row, rows

# append all new features to AirportsA feature class
arcpy.MakeFeatureLayer_management(fcB, "AirportsB_lyr", "OBJECTID &amp;gt; " + str(maxOID))
arcpy.CopyFeatures_management("AirportsB_lyr", "AirportsB_2")
arcpy.Append_management("AirportsB_2", fcA, "NO_TEST")

x = 0

# compare geometries from AirportsA to AirportsB
rows = arcpy.SearchCursor(fcA, "OBJECTID &amp;lt;= " + str(maxOID))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; if geom.area != listB&lt;X&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "OBJECTID " + str(row.OBJECTID) + " has changed"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fcA, "AirportsA_lyr")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("AirportsA_lyr", "NEW_SELECTION", "OBJECTID = " + str(row.OBJECTID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete original features that changed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteFeatures_management("AirportsA_lyr")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fcB, "AirportsB_lyr", "OBJECTID = " + str(row.OBJECTID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # append new split feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management("AirportsB_lyr", fcA, "NO_TEST")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1

del row, rows&lt;/X&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:53:04 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-12-12T01:53:04Z</dc:date>
    <item>
      <title>update field records</title>
      <link>https://community.esri.com/t5/python-questions/update-field-records/m-p/603725#M47172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have two shape files. They are: (i) WashingtonA and (ii) WashingtonB. WashingtonB is a subset of WashingtonA. During processing, additional records were added in WashingtonB. These records were generated by dividing the existing polygons of WashingtonB. Now, I want to update WashingtonA based on updated polygons of WashingtonB. Can you please help me how to do this using Python code? Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 18:38:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-field-records/m-p/603725#M47172</guid>
      <dc:creator>RameshGautam</dc:creator>
      <dc:date>2012-01-31T18:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: update field records</title>
      <link>https://community.esri.com/t5/python-questions/update-field-records/m-p/603726#M47173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Below is an example on how I was able to accomplish this.&amp;nbsp; The OBJECTIDs for the two feature classes were the same, so I first appended all the new features created for a polygon split.&amp;nbsp; Then I compare the original geometry to each geometry in the subset feature class (excluding new features).&amp;nbsp; If the geometry is different, I delete the original feature and update with the new feature (the other half of the geometry that was created from the polygon split).&amp;nbsp; Since I used the OBJECTID I can only run this script once as the OBJECTIDs in the original feature class will change after the appends.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"
env.overwriteOutput = True

fcA = "AirportsA"
fcB = "AirportsB"

OID_list = []
listB = []

# find max OBJECTID
rows = arcpy.SearchCursor(fcA)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; OID_list.append(row.OBJECTID)

del row, rows

maxOID = sorted(OID_list)[-1]

# append all geometries for AirportsB to list
rows = arcpy.SearchCursor(fcB)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; listB.append(geom.area)

del row, rows

# append all new features to AirportsA feature class
arcpy.MakeFeatureLayer_management(fcB, "AirportsB_lyr", "OBJECTID &amp;gt; " + str(maxOID))
arcpy.CopyFeatures_management("AirportsB_lyr", "AirportsB_2")
arcpy.Append_management("AirportsB_2", fcA, "NO_TEST")

x = 0

# compare geometries from AirportsA to AirportsB
rows = arcpy.SearchCursor(fcA, "OBJECTID &amp;lt;= " + str(maxOID))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; if geom.area != listB&lt;X&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "OBJECTID " + str(row.OBJECTID) + " has changed"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fcA, "AirportsA_lyr")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("AirportsA_lyr", "NEW_SELECTION", "OBJECTID = " + str(row.OBJECTID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete original features that changed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteFeatures_management("AirportsA_lyr")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fcB, "AirportsB_lyr", "OBJECTID = " + str(row.OBJECTID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # append new split feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management("AirportsB_lyr", fcA, "NO_TEST")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1

del row, rows&lt;/X&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-field-records/m-p/603726#M47173</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T01:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: update field records</title>
      <link>https://community.esri.com/t5/python-questions/update-field-records/m-p/603727#M47174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot for your help. I apprecaite it. Let me try and see how it goes. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Below is an example on how I was able to accomplish this.&amp;nbsp; The OBJECTIDs for the two feature classes were the same, so I first appended all the new features created for a polygon split.&amp;nbsp; Then I compare the original geometry to each geometry in the subset feature class (excluding new features).&amp;nbsp; If the geometry is different, I delete the original feature and update with the new feature (the other half of the geometry that was created from the polygon split).&amp;nbsp; Since I used the OBJECTID I can only run this script once as the OBJECTIDs in the original feature class will change after the appends.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env
env.workspace = r"C:\temp\python\test.gdb"
env.overwriteOutput = True

fcA = "AirportsA"
fcB = "AirportsB"

OID_list = []
listB = []

# find max OBJECTID
rows = arcpy.SearchCursor(fcA)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; OID_list.append(row.OBJECTID)

del row, rows

maxOID = sorted(OID_list)[-1]

# append all geometries for AirportsB to list
rows = arcpy.SearchCursor(fcB)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; listB.append(geom.area)

del row, rows

# append all new features to AirportsA feature class
arcpy.MakeFeatureLayer_management(fcB, "AirportsB_lyr", "OBJECTID &amp;gt; " + str(maxOID))
arcpy.CopyFeatures_management("AirportsB_lyr", "AirportsB_2")
arcpy.Append_management("AirportsB_2", fcA, "NO_TEST")

x = 0

# compare geometries from AirportsA to AirportsB
rows = arcpy.SearchCursor(fcA, "OBJECTID &amp;lt;= " + str(maxOID))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.Shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; if geom.area != listB&lt;X&gt;:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "OBJECTID " + str(row.OBJECTID) + " has changed"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fcA, "AirportsA_lyr")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.SelectLayerByAttribute_management("AirportsA_lyr", "NEW_SELECTION", "OBJECTID = " + str(row.OBJECTID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete original features that changed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DeleteFeatures_management("AirportsA_lyr")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeFeatureLayer_management(fcB, "AirportsB_lyr", "OBJECTID = " + str(row.OBJECTID))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # append new split feature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Append_management("AirportsB_lyr", fcA, "NO_TEST")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += 1

del row, rows&lt;/X&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-field-records/m-p/603727#M47174</guid>
      <dc:creator>RameshGautam</dc:creator>
      <dc:date>2021-12-12T01:53:07Z</dc:date>
    </item>
  </channel>
</rss>

