From 6936993ed64a7e90ff19162e3007b7c1b0a07ea7 Mon Sep 17 00:00:00 2001 From: cjsostad Date: Wed, 20 Nov 2024 11:24:38 -0800 Subject: [PATCH] somewhat fixed the beta location error --- autoast/4_jobs_tested.xlsx | Bin 9345 -> 7660 bytes autoast/ast.tbx | Bin 0 -> 65536 bytes ...t_V2_Cuisineart.py => autoast_Indexing.py} | 0 ...omated_status_sheet_call_routine_arcpro.py | 671 ++++++++++++++++++ 4 files changed, 671 insertions(+) create mode 100644 autoast/ast.tbx rename autoast/{autoast_V2_Cuisineart.py => autoast_Indexing.py} (100%) create mode 100644 autoast/automated_status_sheet_call_routine_arcpro.py diff --git a/autoast/4_jobs_tested.xlsx b/autoast/4_jobs_tested.xlsx index 2a225ef7ade6462491c5b56a217656a9172d9db4..d5539dbf92d15dc9e210b8fe1cdca452b47624c3 100644 GIT binary patch delta 5866 zcmZu#2UHVVv`vuE5k$K5B49uQh)5MdKH{K@8HaD;^1)G!_HPELWQ^)LjLeladjH5v&|yFGLkjd<^4$HZqzebx4^R( zTAw2^5;Ksnk5t`yt?cf?L9Kbd*SZt{)x`2Gvcm;*3Y_#-dQ8&&o}t$#ELu6r5jQ%n z7*i<=^{1RMu2+eDW2hHi;8`uI2~13NNw5~+K1#6JjR+jCXRfwCHUTxFPC$Puyw`-F z*u^Re#sL7X{jRW?y_5M*jr(FgtF}N$f{Z{*Gh$sg$u$y)E%R7e1qfUD6zlm65X17p z8g(^!d@y`}{5jfF^fz=2_(q)Fb*a3&rfiYNxn!=WxNxu=O9&AQ<_aFFhjoyo&oIS5 zV?ODCJX|ta(tq)c8Yjjvh$O6ut^Z*z*dk8FGGE1_zCuXKH`~i!lvvNKDM;|OCSdq$ ztH<{>qEh5F`9ztETj?pmTKj72CL=&M)q@FiLFrmITwp1P5w~8_?rE+o@$56f@V0sA zL5S)#=(^ys>&|wqp%CAPC)6^OG4^c@F;DomW)#MmeWCLMVvW0(U3#~Ur;ph3!AGt% zC)a=fMir&NaS-KyTg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pw9&oLNFuz#|;1a zy*cuyzJGQ{5HgpfMgZ@XfSLb$KqBhO1tFF&B7)zT$vCcby70rFm+DIa#4{Elz;2Fs z_XX>}Z>v|#LBzk*zq-5rdzC+-^_3t9gh~zv+T_5W8~!&Qyb_3o`|Ce}{tr03TI}!G z_%nKysebAC_qn7+OgOK=2?zvd{EghHV7?Ig-zIAp_4}%PU-2eWUzp*{6h)9o@iZ1@c$pSAPQjs diff --git a/autoast/ast.tbx b/autoast/ast.tbx new file mode 100644 index 0000000000000000000000000000000000000000..fe04c9685aad4bacdb2a3bd422de59e261b783fa GIT binary patch literal 65536 zcmeHwdypi@S!a*sha_7%OFmnE@F?{fX=Q7tXJ$wC?y9$?dG3z2yEC2{y{v({n(msJ z_I7u*s;ad!tQ9yM!6OLF0d_zH#Knbe;Cu$ch9H2zoG}o<9|Rx*3=wdFv4KAb2=ll< z&ID)A{eJm%c2-qazh+w6m0dlN(^Zw3UuJ%<{Jt-AgtnNE=9-NRJ~uf%GKOQ%FxEy$|Ubq%EZHMEWiy8|l9wIY{j5jry$TJp6^A#Zs<; zZ$Ec{9u5C_6F5fqePTeh4^IA`{{#2^)x<3*_b8bJpC@uI+6;14^r9h;M*9Ey+$$!? zx70=K$FP+jZ5Lcn?S|+DM;{DZy;JUPw6DiMZ2QF1rzlYPY%2WM6fet@(f+>&jVk}d$++bIM#^@SFM3_SI!B7? z4~23Aa^N7flvFlyyU-1qO9NcbL0-$yed|gGQs;NqFy-T=p9iZIAK94@+F8Hpq z=!9-*W@=_?>h$#4VxjX$Wo}mMZfSaY>Rk_=nVOPJ^{6=KmoKbrEPH<42}@|cScp9- zZX7hqtBtZ-+FXBpsaWXT7B731M2q?fvm)&k3;MoTklu!#SKIdXt%g%~&*wKnCu{{6 zueFKifra+h)>reEQ>!{bBwOXSGfPFsFY^JwTy$&AH7DFFx#zZmYjz{tLf&pQ*lPOT z*18*bEx+srTP(J<+bkARY8Kg}zzu^!saW7Oz?O5U;6jJ5be~v{ulJ1g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 zR_u+bZtfh`UXCC2n;iq~t2vfliOk&bBdWU(tBv9ryU`}NB~9<1=XLhUFpyy&!$5|C z3 true + arcpy.AddMessage("deleting " + data_gdb) + arcpy.Delete_management(data_gdb) + arcpy.CreateFileGDB_management(directory_to_store_output, gdb_name) + elif dont_overwrite_outputs == "true": + arcpy.AddWarning("GDB exists and dont_overwrite_outputs is set to true") + else: + arcpy.AddMessage("creating " + data_gdb) + arcpy.CreateFileGDB_management(directory_to_store_output, gdb_name) + + + ''' + Gets the aoi_boundary, from the feature layer. + this boundary is put in the aoi_boundary.gdb as AOI. This + AOI will be used by the revolt overlap tool as it's area of interest, + and by "part2" of the tool that creates the first 2 tabs of the final xlsx. + ''' + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("Checking AOI") + + the_clean_output = os.path.join(data_gdb , "aoi_clean") + if not arcpy.Exists(the_clean_output): + # create feature dataset + feature_dataset_name = "input_of_raw_data" + arcpy.CreateFeatureDataset_management(data_gdb, feature_dataset_name, spatial_reference) + + # copy aoi feature(s) to the raw feature dataset + the_output = os.path.join(data_gdb, feature_dataset_name, "aoi_boundary_raw") + # check if output exists + if not arcpy.Exists(the_output): + # Get data from user supplied feature layer + if arcpy.Exists(feature_layer): + arcpy.AddMessage(" getting AOI boundary from feature layer -- copying to GDB") + # get data frin BCGW with user supplied crown_file_number + elif crown_file_number: + arcpy.AddMessage(" getting parcel boundary from tantalis") + arcpy.MakeFeatureLayer_management(os.path.join(sde, "WHSE_TANTALIS.TA_CROWN_TENURES_SVW"), + "input_layer") + selection_string = "\"CROWN_LANDS_FILE\" = " + "'" + crown_file_number + "'" + selection_string = selection_string + " and " + selection_string = selection_string + "\"DISPOSITION_TRANSACTION_SID\" = " + "'" + disposition_number + "'" + + if parcel_number != "" and parcel_number != "#": + selection_string = selection_string + " and " + selection_string = selection_string + "\"INTRID_SID\" = " + parcel_number + + arcpy.AddMessage(f'Query: {selection_string}') + + # Select features + feature_layer, count = arcpy.SelectLayerByAttribute_management("input_layer", "NEW_SELECTION", selection_string) + input_layer_count = int(str(arcpy.GetCount_management("input_layer"))) + + arcpy.AddMessage(f'* count: {count}, input_layer_count: {input_layer_count}') + + # Check + if input_layer_count == 0: + arcpy.AddError("The crown file / disposition pair was not found in the BCGW Tantalis data. ") + sys.exit() + + # Copy to input_of_raw_data dataset + arcpy.CopyFeatures_management(feature_layer, the_output) + # Copy to root of GDB + arcpy.CopyFeatures_management(the_output, the_clean_output) + arcpy.RepairGeometry_management(the_clean_output) + + + + #___________ + # AOI Validation + ''' + Checks the inputs AOI data for common issues + ''' + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("Checking for possible errors in AOI shape") + + # Variables + message_dict = {} # holds possible error name and message + possible_problems_with_input_shape = 'no' # FLAG - No errors, so far + + # Catch MULTIPART + multipart = 'no' + with arcpy.da.SearchCursor(the_clean_output, ["SHAPE@"]) as cursor: #@UndefinedVariable + for row in cursor: + geometry = row[0] + if geometry.isMultipart == True: + multipart = 'yes' + possible_problems_with_input_shape = 'yes' + # Report + message_string = "is this shape multipart ? " + " " + multipart + message_dict["multipart"] = [multipart, message_string] + + # Catch > 1 Features + multiple_polygons = 'no' + result = arcpy.GetCount_management(the_clean_output) + count = int(result.getOutput(0)) + if count > 1: + multiple_polygons = 'yes' + possible_problems_with_input_shape = 'yes' + # Report + message_string = "are there multiple polygons ? " + " " + multiple_polygons + message_dict["multiple_polygons"] = [multiple_polygons, message_string] + + # Catch too many Vertices + lots_of_vertices = 'no' + features = [feature[0] for feature in arcpy.da.SearchCursor(the_clean_output,"SHAPE@")] #@UndefinedVariable + count_vertices = sum([f.pointCount-f.partCount for f in features]) + #print "count_vertices " , count_vertices + if count_vertices > 5000: + lots_of_vertices = 'yes' + possible_problems_with_input_shape = 'yes' + # Report + message_string = "are there lots of vertices ? " + " " + lots_of_vertices + message_dict["lots_of_vertices"] = [lots_of_vertices, message_string] + + message_string = "are there possible problems with you input FC ? " + " " + possible_problems_with_input_shape + message_dict["possible_problems_with_input_shape"] = [possible_problems_with_input_shape, message_string] + + for k, v in message_dict.items(): #@UnusedVariable + flag, message = v + if flag == "yes": + pass + #arcpy.AddWarning(message) + else: + pass + #arcpy.AddMessage(message) + #print(k) + arcpy.AddMessage(" {}".format(message)) + + the_aoi = os.path.join(data_gdb , "aoi") #create additional feature class as input to the UOT without the fields. + + + #___________ + # Prepare Variables to pass into tool + ''' + Sets up all the Variables that need to be passed into the + Universal Overlap Tool. Most of them will be blank because + they are only accessed from the Generic Tool Interface. + If the debug_version flag is set to True, than the input + spreadsheets are set to small version so the testing runs + quickly. + + Also sets up the variables to be passed into the the second + part of the tool that creates tab1 and tab2 of the final spreadsheet + ''' + + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("Preparing to pass variables") + revolt_criteria_to_pass = [] + revolt_criteria_to_pass.append(the_aoi) # 0 TEXT - analyize_this_featureclass + revolt_criteria_to_pass.append(r"") # 1 TEXT - create_subreports_on_this_field + revolt_criteria_to_pass.append(r"") # 2 TEXT - what_type_of_overlap_to_run + revolt_criteria_to_pass.append(xls_file_for_analysis_input) # 3 TEXT - xls_file_for_analysis_input + revolt_criteria_to_pass.append(r"") # 4 TEXT - text_header1 + revolt_criteria_to_pass.append(r"") # 5 TEXT - text_header2 + revolt_criteria_to_pass.append(r"") # 6 TEXT - text_header3 + revolt_criteria_to_pass.append(r"") # 7 TEXT - text_header4 + revolt_criteria_to_pass.append(r"") # 8 TEXT - True - subreports_on_seperate_sheets + revolt_criteria_to_pass.append(directory_to_store_output) # 9 TEXT - directory_to_store_output + revolt_criteria_to_pass.append(r"") # 10 TEXT - True - summary_fields_on_seperate_lines + revolt_criteria_to_pass.append(dont_overwrite_outputs) # 11 TEXT - True - test_dont_overwrite_data_and_maps + revolt_criteria_to_pass.append(xls_file_for_analysis_input2)# 12 TEXT - xls_file_for_analysis_input2 reads a second input spreadsheet into the list + revolt_criteria_to_pass.append("INTERNAL PROVINCIAL GOVERNMENT USE ONLY") # 13 TEXT - xls_file_for_analysis_input2 reads a second input spreadsheet into the list + revolt_criteria_to_pass.append(suppress_map_creation) # 14 TEXT - Dont try to create the maps on tab 3 + revolt_criteria_to_pass.append(region) #19 TEXT - Natural Resource Region + revolt_criteria_to_pass.append(crown_file_number) #20 TEXT - Crown Lands File + revolt_criteria_to_pass.append(disposition_number)#21 TEXT - Disposition Number + revolt_criteria_to_pass.append(parcel_number) #22 TEXT - Parcel Number + revolt_criteria_to_pass.append(run_as_fcbc) #23 TEXT - run spreadsheets in FCBC format + revolt_criteria_to_pass.append(add_maps_to_current) + + + one_status_part2_criteria_to_pass = [] + one_status_part2_criteria_to_pass.append(directory_to_store_output) + one_status_part2_criteria_to_pass.append(dont_overwrite_outputs) # don't overwrite data if it already exists + one_status_part2_criteria_to_pass.append(region) # TEXT - Natural Resource Region + one_status_part2_criteria_to_pass.append(crown_file_number) # TYPE - Crown Lands File + one_status_part2_criteria_to_pass.append(disposition_number)# TYPE - Disposition Number + one_status_part2_criteria_to_pass.append(parcel_number) # TYPE - Parcel Number + #one_status_part2_criteria_to_pass.append(r"") + #one_status_part2_criteria_to_pass.append(r"") + #one_status_part2_criteria_to_pass.append(r"") + one_status_part2_criteria_to_pass.append(the_aoi) + + + #___________ + # RUN TOOLS + + arcpy.AddMessage("Passing variables") + # PART 1 - Run Conflicts and Constraints + ''' + Runs the universal_overlap_tool on PARCEL_BOUNDARY.GDB\AOI + if the flag to skip it has not been set to True + ''' + if skip_conflicts_and_constraints == "false": + arcpy.AddMessage("") + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("{0} Running Universal Overlap Tool {0}".format("*"*3)) + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("") + # Remove all non-required fields from the AOI feature class. When the AOI contains + # fields that are common with the input constraints, it causes an issue with the output + # XLS file where the reporting of the data in the common field does not get written. + # (added May 3, 2021) + arcpy.CopyFeatures_management(the_clean_output, the_aoi) + arcpy.AddMessage("Deleting fields from AOI to avoid conflicts...") + for field in arcpy.ListFields(the_aoi): + if not field.required: + try: + print(f"deleting {field.name} from AOI dataset") + arcpy.DeleteField_management(the_aoi, field.name) + except: + arcpy.AddMessage(arcpy.GetMessages()) + revolt_obj = revolt.revolt_tool() + revolt_obj.run_revolt_tool(revolt_criteria_to_pass) + + # PART 2 - Automated Status + ''' + Runs Part2 of the Automated Status Tool. + This creates the one_status_tabs_1_and_2.xlsx + ''' + arcpy.AddMessage("") + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("{0} Running Automated Status Tool {0}".format("*"*3)) + arcpy.AddMessage("======================================================================") + arcpy.AddMessage("") + arcpy.Delete_management(the_aoi) + arcpy.CopyFeatures_management(the_clean_output, the_aoi) + arcpy.Delete_management(the_clean_output) + onestatus_obj = one_status_part2.one_status_part2_tool() + onestatus_obj.run_tool(one_status_part2_criteria_to_pass) + + #___________ + # Merge Sheets into Final Workbook + ''' + Merges the 2 spreadsheets into the final Automated_Status_Sheet.xlsx + Both input spreadsheets must exist for the final one to be created, else + the user will just have to use the individual spreadsheets. + ''' + arcpy.AddMessage("Starting the merge of two XLS files") + # XLSX Variables + part1_xlsx = os.path.join(directory_to_store_output,"one_status_common_datasets_aoi.xlsx") + part2_xlsx = os.path.join(directory_to_store_output,"one_status_tabs_1_and_2.xlsx") + part3_xlsx = os.path.join(directory_to_store_output,"automated_status_sheet.xlsx") + # Catch Debug Flag + if debug_version == 'true' : + part1_xlsx = os.path.join(directory_to_store_output,"one_status_common_datasets_debug_version_aoi.xlsx") + + # Prepare files (some as VARS and some deleted, if conditions are met) + if os.path.isfile(part1_xlsx) and os.path.isfile(part2_xlsx): + if os.path.isfile(part3_xlsx): + arcpy.AddMessage(". Overwriting the existing working XLSX:\n {}".format(part3_xlsx)) + arcpy.Delete_management(part3_xlsx) + # Make copy + shutil.copy(part1_xlsx, part3_xlsx) + #shutil.copy(part2_xlsx, part3_xlsx) + # workbook objects + arcpy.AddMessage(". loading the workbooks") + dst_wb = openpyxl.load_workbook(part3_xlsx) + src_wb = openpyxl.load_workbook(part2_xlsx) + # names of sheets of interest + src_ws_list = ["Status of Conflict", "Crown Land Status"] + # worksheet names from src workbook + src_wss = sorted(src_wb.sheetnames, reverse=True) + # loop through sheet names (from src) + for ws in src_wss: + #print(ws) + #loop through sheet names of interest + for name in sorted(src_ws_list, reverse=True): + # find match + if ws == name: + # worksheet object + worksheet = src_wb[name] + # call the copy function + copySheet_toNewWB(worksheet, name, dst_wb, part3_xlsx) + + elif os.path.isfile(part2_xlsx): + print("Only 1 file found:\n {}".format(part2_xlsx)) + # Make copy + shutil.copy(part2_xlsx, part3_xlsx) + + if arcpy.Exists(part3_xlsx): + arcpy.AddMessage(".") + arcpy.AddMessage(".") + arcpy.AddMessage("Automated_status_sheet.xlsx is ready for you to use") + arcpy.AddMessage("{}".format(part3_xlsx)) + arcpy.AddMessage(".") + arcpy.AddMessage(".") + + #cleanup temporary sde file + try: + shutil.rmtree(os.path.dirname(os.path.abspath(os.getenv("SDE_FILE_PATH")))) + del os.environ["SDE_FILE_PATH"] + except Exception as e: + pass + + +#___________________________________________________________________________ + +## FUNCTIONS ## + +def apply_border2(ws, start_row, end_row, start_column, end_column): + ''' + Applies a thick black border to a range of cells + ''' + + cell_range = start_column + str(start_row+1) + ":" + end_column + str(end_row) + rows = ws[cell_range] + for row in rows: + if row == rows[0][0] or row == rows[0][-1] or row == rows[-1][0] or row == rows[-1][-1]: + pass + else: + row[0].border = Border(left=Side(style='thick')) + row[-1].border = Border(right=Side(style='thick')) + for c in rows[0]: + c.border = Border(top=Side(style='thick')) + for c in rows[-1]: + c.border = Border(bottom=Side(style='thick')) + rows[0][0].border = Border(left=Side(style='thick'), top=Side(style='thick')) + rows[0][-1].border = Border(right=Side(style='thick'), top=Side(style='thick')) + rows[-1][0].border = Border(left=Side(style='thick'), bottom=Side(style='thick')) + rows[-1][-1].border = Border(right=Side(style='thick'), bottom=Side(style='thick')) + +def copySheet_toNewWB(src_ws, ws_name, dst_wb, dst_wb_path): + ''' + Copies cell values and styles from a Source Worksheet to a Destination Worksheet. + The script iterates through row and columns, writing cells one-by-one. + ''' + # range of cells to be copied + max_row = src_ws.max_row + max_col = src_ws.max_column + # Column widths from src + col_width_dict = {} + for col in range(1, max_col+1): + ltr = openpyxl.utils.cell.get_column_letter(col) #@UndefinedVariable + col_width_dict[col] = [ltr, src_ws.column_dimensions[ltr].width] + # Get dst WS ready + dst_ws_name = ws_name + # New Workbook and Worksheet + dst_wb.create_sheet(dst_ws_name, 0) + dst_ws = dst_wb[dst_ws_name] + # Update column width in dst WS + for k, v in col_width_dict.items(): + dst_ws.column_dimensions[v[0]].width = v[1] + del col_width_dict, k, v + # Loop over rows + for row in range(1, max_row+1): + # set dst row height f rom src + src_row_height = src_ws.row_dimensions[row].height + if src_row_height != None: + dst_ws.row_dimensions[row].height = src_row_height + # loop over columns + for col in range(1, max_col+1): + # Copy src cell contents to dst + src_cell = src_ws.cell(row=row, column=col) + dst_cell = dst_ws.cell(row=row, column=col) + # Cells not merged + if type(dst_cell).__name__ != 'MergedCell': + # value + dst_cell.value = src_cell.value + # get source style + src_font = src_cell.font + src_fill = src_cell.fill + src_alignment = src_cell.alignment + src_border = src_cell.border + # apply style + if src_cell.has_style: + # Applies only styles named below (Font, PatternFill, Alignment, and Border) + dst_cell.font = Font(name=src_font.name, + size=src_font.size, + color=src_font.color) + dst_cell.fill = PatternFill(fill_type=src_fill.fill_type, + fgColor=src_fill.fgColor) + dst_cell.alignment = Alignment(horizontal=src_alignment.horizontal, + wrap_text=src_alignment.wrap_text) + dst_cell.border = Border(left=src_border.left, + right=src_border.right, + top=src_border.top, + bottom=src_border.bottom) + + # Catch cells that need merging + # Variables + col_ltr = openpyxl.utils.cell.get_column_letter(col) #@UndefinedVariable + col_ltr_2 = openpyxl.utils.cell.get_column_letter(col+1) #@UndefinedVariable + # Do the merging + if dst_cell.value is not None and \ + (dst_cell.value in ["Additional Comments", "Status Summary"] or \ + "Purpose: " in dst_cell.value[:9]): + if "Purpose: " in dst_cell.value[:9] or "Status Summary" in dst_cell.value: + merge_range = col_ltr + str(row) + ":" + col_ltr_2 + str(row) + elif dst_cell.value == "Additional Comments": + row = row + 1 + merge_range = col_ltr + str(row) + ":" + col_ltr_2 + str(row) + + dst_ws.merge_cells(merge_range) + apply_border2(dst_ws, row-1, row+1, "A", "B") + dst_cell.alignment = Alignment(horizontal=src_alignment.horizontal, + wrap_text=src_alignment.wrap_text) + #print("{}:{} --> {}".format(col_ltr, row, dst_cell.value)) + dst_wb.save(dst_wb_path) + +#___________________________________________________________________________ +if __name__=='__main__': + main()