I'm trying to understand how to use FieldMap and FieldMappings. I know very little about objects plus I'm finding the explanations on ESRI website not very good and far from comprehensive. All I'm trying to do is to perform a spatial join between two polygon datasets and I need to bring over to the target feature class 2 fields from the join class and the merge rule should be 'First'.
Can anyone please explain how to do this?
All I have is this incomplete piece of code:
fm = arcpy.FieldMap()
fm.mergeRule = 'First'
arcpy.SpatialJoin_analysis('fl_London_Bldngs', 'fl_VS2_agl_polyg_1', fc_VS2_agl_polyg, join_operation = 'JOIN_ONE_TO_ONE', match_option = 'INTERSECT', join_type = 'KEEP_COMMON', field_mapping = .....)
NOTE: Several polygons from the join feature class can intersect with 1 target feature. Therefore the need to establish a rule to choose the first value of those intersecting features.
Could anyone recommend a site where all this is nicely explained?