-
Notifications
You must be signed in to change notification settings - Fork 0
import_hwyproj_coding()
ccai-cmap edited this page Sep 25, 2025
·
2 revisions
This method reads the project coding from import_hwy_project_coding.xlsx and imports them into the project coding table.
This method checks for three things:
- Each row must have all four required fields filled in: TIPID, ANODE, BNODE, and ACTION CODE.
- ANODE-BNODE must correspond to a valid link in the highway network (so that ABB can be calculated).
- Each row must be uniquely identifiable by its TIPID-ABB combination.
If any of the rows fail, the program crashes. Offending rows will be written to import_project_coding_errors.csv.
The imported rows are then divided into 3 groups.
- Group 1 - rows to delete, where the TIPID-ABB combination already exists in the project table. These rows are removed from the project coding table.
- Group 2 - rows to update, where the TIPID-ABB combination already exists in the project table. These rows are updated (overwritten) by the imported rows.
- Group 3 - rows to insert, where the TIPID-ABB combination does not already exist in the project table. The imported rows are inserted into the project table.
Now that all imported rows are in the project table, they can be checked for integrity by check_hwy_project_table() just like the original rows.