"""Name: RubbersheetFeatures_example_script2.py
Description: Performs rubbersheeting spatial adjustment using links produced by
GenerateRubbersheetLinks, assuming newly updated roads are more
accurate than existing base roads. The links go from base road data
to corresponding newly updated road data. The links are then
analyzed for potential errors. They are then used to adjust the
base roads (a copy is made) to better align with the updated roads.
"""
import arcpy
arcpy.env.overwriteOutput = True
arcpy.env.workspace = r"D:\conflationTools\ScriptExamples\data.gdb"
sourceFeatures = "baseRoads"
targetFeatures = "updateRoads"
grlOutput = "grlinks_out"
grlOutputPts = "grlinks_out_pnt"
search_distance = "300 Feet"
match_fields = "FULLNAME RD_NAME"
qaLocations = "qa_locations"
arcpy.edit.GenerateRubbersheetLinks(sourceFeatures, targetFeatures, grlOutput, search_distance, match_fields)
"""
Note 1: The result of GenerateRubbersheetLinks may contain errors; see the tool reference.
Inspection and editing may be necessary to ensure correct links before using
them for rubbersheeting.
One of the common errors is intersecting or touching links. Their locations
can be found by the process below.
"""
arcpy.analysis.Intersect(grlOutput, qaLocations, "", "", "POINT")
arcpy.management.DeleteIdentical(qaLocations, "Shape")
"""
Note 2: You can manually inspect locations in qaLocations and delete or
modify links as needed.
"""
arcpy.management.CopyFeatures(sourceFeatures, "sourceFeatures_Copy")
arcpy.edit.RubbersheetFeatures("sourceFeatures_Copy", grlOutput, grlOutputPts, "LINEAR")