Hello,
I am trying to create a python toolbox tool in which I want to give multiple input vector layers, loop through them with summarize within analysis and make two new columns based on each input vector layer with calculate field function.
The problem I have is that after each iteration the calculate field function overwrites the columns based on the previous input data.
Does anybody know how I can solve this problem?
The whole code can be found here: https://github.com/Geoc0der/code_in_progress/blob/main/summarizewithin_toolbox_1
I think your issues is that arcpy.analysis.SummarizeWithin(input_grid_layer,input_data_parameter,output,shape_unit='SQUAREMETERS') is overwriting the existing content feature class with the results of the current iteration. Maybe create temporary output feature class for each iteration? or ensure that every iteration creates unique field names for the calculated fields.