<?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: Correcting Drift in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267931#M66650</link>
    <description>&lt;P&gt;If you have a unique id field with the same values in the wrong and correct layers, you can use a little Python script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# parameters
wrong_geometries_fc = "TestPoints"  # layer name or path to the shapefile
wrong_geometries_id_field = "IntegerField2"  # name of the id field
correct_geometries_fc = "TestPointsAGOL"
correct_geometries_id_field = "IntegerField2"

# read the correct geometries
correct_geometries = {i: shp for i, shp in arcpy.da.SearchCursor(correct_geometries_fc, [correct_geometries_id_field, "SHAPE@"])}

# iterate over the wrong geometries
with arcpy.da.UpdateCursor(wrong_geometries_fc, [wrong_geometries_id_field, "SHAPE@"]) as cursor:
    for i, shp in cursor:
        # find the correct geometry and update
        try:
            correct_geometry = correct_geometries[i]
            cursor.updateRow([i, correct_geometry])
        except KeyError:
            print(f"No correct geometry found for {wrong_geometries_id_field} = {i}")&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 15 Mar 2023 10:01:56 GMT</pubDate>
    <dc:creator>JohannesLindner</dc:creator>
    <dc:date>2023-03-15T10:01:56Z</dc:date>
    <item>
      <title>Correcting Drift</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267914#M66647</link>
      <description>&lt;P&gt;Hey everyone,&lt;/P&gt;&lt;P&gt;I am working with shapefiles which in part contain the same points but I assume due to reprojections in the past or possibly recalculations of geometries with different accuracies, those points drifted apart and i am now left with files that plot like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MapsBerlin_0-1678871437310.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/65294iBCBEBE3794EB45F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MapsBerlin_0-1678871437310.png" alt="MapsBerlin_0-1678871437310.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there any tools availible to identify and correct this drift so I can properly identify the matching points? Sadly the drift is not completely uniform across all points so simply moving all points by x/y is not an option.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas appreciated. Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 09:18:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267914#M66647</guid>
      <dc:creator>Maps-Berlin</dc:creator>
      <dc:date>2023-03-15T09:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Drift</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267931#M66650</link>
      <description>&lt;P&gt;If you have a unique id field with the same values in the wrong and correct layers, you can use a little Python script:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# parameters
wrong_geometries_fc = "TestPoints"  # layer name or path to the shapefile
wrong_geometries_id_field = "IntegerField2"  # name of the id field
correct_geometries_fc = "TestPointsAGOL"
correct_geometries_id_field = "IntegerField2"

# read the correct geometries
correct_geometries = {i: shp for i, shp in arcpy.da.SearchCursor(correct_geometries_fc, [correct_geometries_id_field, "SHAPE@"])}

# iterate over the wrong geometries
with arcpy.da.UpdateCursor(wrong_geometries_fc, [wrong_geometries_id_field, "SHAPE@"]) as cursor:
    for i, shp in cursor:
        # find the correct geometry and update
        try:
            correct_geometry = correct_geometries[i]
            cursor.updateRow([i, correct_geometry])
        except KeyError:
            print(f"No correct geometry found for {wrong_geometries_id_field} = {i}")&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Mar 2023 10:01:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267931#M66650</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-03-15T10:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Correcting Drift</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267956#M66653</link>
      <description>&lt;P&gt;Hey Johannes,&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your reply. Sadly I have nothing in the Attributes to reference those two files with one another. Plus (I am guessing) this would only correct the matching points and leave all non matching points as is, the drift is affecting all points though and I was hoping to find a tool which identifies the drift based on the matching points and then applies a correction to all points. Now that I write that out I realize that I should maybe look into machine learning.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 11:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/correcting-drift/m-p/1267956#M66653</guid>
      <dc:creator>Maps-Berlin</dc:creator>
      <dc:date>2023-03-15T11:18:58Z</dc:date>
    </item>
  </channel>
</rss>

