SORRY! Found the error myself, immediately as I saw my post... wrong feature in the spatialjoin command...So ignore this post, please!PS: No delete option here?##--------------------------------------------------------------------------------------Hi there, I want to do a spatial join with a polyline feature (target) and a point feature. In the new polyline-feature all fields of both features should appear. With the default values I only get the fields of the target-feature (correctly) and the ID field of the join-feature. So I tried fieldmapping and added the tables manually like this:
fieldmappings = arcpy.FieldMappings()
fieldmappings.addTable(inputFC)
fieldmappings.addTable(PS_copy)
arcpy.SpatialJoin_analysis (inputFC, PS, outputFC, "#", "#", fieldmappings, "INTERSECT")
This results in a feature table with the right fields, but except of the ID field of the join-feature the other fields have the value 0. What's wrong with my code?If this is a stupid question, I'm sorry, I'm quite new to python-scripting...Thanks!Selda