from forestloss_classes import directories as dir scratch_gdb,outdir,merged_dir = dir.dirs(maindir) from forestloss_classes import check_duplicates as check from forestloss_classes import correct_rownames as rownames from forestloss_classes import unique_id as unique_id check.check_dups(input_shapefile,column_name) unique_id.unique_id(input_shapefile,column_name) # prep boundary if necessary if summarize_by != "do not summarize by another boundary": # if user is summarizing by admin boundary, need to create a new id column based on # the intersection of column_name value and iso values arcpy.AddMessage('Intersecting with {} boundary'.format(summarize_by)) from forestloss_classes import boundary_prep as boundary_prep shapefile,admin_column_name = boundary_prep.boundary_prep(input_shapefile,summarize_by,adm0,adm1,adm2,outdir,filename,summarize_by_columnname,summarize_file) arcpy.AddMessage(admin_column_name) else: shapefile = input_shapefile admin_column_name = column_name total_features = int(arcpy.GetCount_management(shapefile).getOutput(0)) start = datetime.datetime.now() option_list = [] if forest_loss == "true": option_list.append("forest_loss") if carbon_emissions == "true": option_list.extend(["biomass_max", "biomass_min"])
arcpy.env.workspace = maindir arcpy.CheckOutExtension("Spatial") arcpy.env.overwriteOutput = "TRUE" scratch_gdb, outdir, merged_dir = dir.dirs(maindir) arcpy.env.scratchWorkspace = scratch_gdb check.check_dups(input_shapefile, column_name) unique_id.unique_id(input_shapefile, column_name) # prep boundary if necessary if summarize_by != "do not summarize by another boundary": arcpy.AddMessage('Intersecting with {} boundary'.format(summarize_by)) from forestloss_classes import boundary_prep as boundary_prep shapefile, admin_column_name = boundary_prep.boundary_prep( input_shapefile, summarize_by, adm0, adm1, adm2, maindir, filename, summarize_by_columnname, summarize_file) else: shapefile = input_shapefile admin_column_name = column_name total_features = int(arcpy.GetCount_management(shapefile).getOutput(0)) start = datetime.datetime.now() option_list = [] if forest_loss == "true": option_list.append("forest_loss") if carbon_emissions == "true": option_list.extend(["biomass_max", "biomass_min", "biomass"]) if tree_cover_extent == "true":