I am trying to perform a spatial join to join attributes from a point feature layer to the attributes of a line feature layer where the points are within a specified distance of the lines (so that these attributes can later be used in an update cursor). Currently, I am receiving a '000561: Relationship invalid for selected layers' error while trying to run this piece in Visual Studio. A spatial join based on distance between point and line features appears to work without a hitch in ArcMap and ModelBuilder. I would like to avoid field mapping if possible, but maybe that is something I may need to add in.
What am I missing?
import arcpy from arcpy import env arcpy.env.OverwriteOutput = True defaultGdbPath = 'C:\Topo_Check_Tess_V5.gdb' #lines transLayer='C:\Topo_Check_Tess_V5.gdb\Transmission' #points ppLayer='C:\Topo_Check_Tess_V5.gdb\PP' #Make feature layer arcpy.MakeFeatureLayer_management(ppLayer, "ppLayerGU") #Make feature layer arcpy.MakeFeatureLayer_management(transLayer, "transLayerGU") #output join fc pp_trans_GUJoin ='C:\Topo_Check_Tess_V5.gdb\pp_trans_GU_SpatialJoin' #spatial join of feature layers arcpy.SpatialJoin_analysis ("transLayerGU", "ppLayerGU", pp_trans_GUJoin,'JOIN_ONE_TO_ONE','KEEP_ALL','WITHIN_A_DISTANCE',.000002)