I have two feature classes "Par" which is the large boundary(Red line) and "Par1" which is just parcels (black lines). The issues is I only get one single parcel populated with my current code. In the example attached, there are 6 parcels within the red boundary and I need all 6 of those parcels to be in the "PARCELS" field. I have the following code and on line 23 I have indicated that I want to use the Join as the merge rule. The "PARCEL" field on line 23 is the Data source field in Par1 that has each parcel. As far as the map options I have tried, INTERSECT, HAVE_THEIR_CENTER_IN, CONTAINS, WITHIN and it's the same results. I am assuming I am over looking something but I am not sure what it is...
import sys, arcpy, os, fnmatch
from arcpy import env
from datetime import datetime as d
startTime = d.now()
start_time = time.time()
print ('Started')
arcpy.env.overwriteOutput = True
arcpy.env.qualifiedFieldNames = False
arcpy.env.workspace = r"C:\Temp\Scratchworkspace.gdb"
fc_Delete = ["BlahTest"]
Par = "C:/Temp/Diss_Par.shp"
Par1 = "C:/Temp/Parcels.shp"
FieldMapString = '''
PIN "PIN" true true false 13 Text 0 0 ,First,#, {0}, PIN,-1,-1;
ACRES "ACRES" true true false 4 Double 0 0 ,First,#, {0}, ACRES,-1,-1;
PARCELS "PARCELS" true true false 200 Text 0 0 ,Join,#, {0}, PARCEL,-1,-1
'''
def Layers1(Par1):
fieldmappings = arcpy.FieldMappings()
fieldmappings.loadFromString(FieldMapString)
return fieldmappings
def main(args=None):
if args is None:
args = sys.argv
arcpy.SpatialJoin_analysis(Par, Par1, "BlahTest", "JOIN_ONE_TO_ONE", "KEEP_ALL",Layers1(Par1), "HAVE_THEIR_CENTER_IN")
print (" Spatial Join Finished")
print ('(Elapsed time: ' + str(d.now() - startTime)[:-3] + ')')
<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>