Skip to content

check_hwyproj_coding_table()

ccai-cmap edited this page Sep 25, 2025 · 13 revisions

With this method, the integrity of the project table will be checked.

A diagram showing what check_hwy_project_table() checks.

In the base project table, a field called "USE" was created by create_base_hwy(). A "USE" value of 1 is the default and means that the row is valid. A "USE" value of 0 means that the row is invalid and the project row will not be applied.

If a row is determined to be invalid, it will be considered an error and its "USE" field will be set to 0. The "PROCESS_NOTES" field will also be populated with a small description of the error. Otherwise, if a row is determined to be valid but strange, it will be considered a warning. Its "USE" field will stay as 1, but the "PROCESS_NOTES" field will be populated with a small description of the warning.

In the output folder, a text file called "base_project_table_errors.txt" will be created that summarizes all the errors and warnings. Additionally, an excel file called "base_project_table_errors.xlsx" will be created of all the rows with errors or warnings.

The method checks the table in 3 stages. The first is the Primary Key check, which determines that each row in the table can be uniquely identified by its TIPID-ABB combination. The second is the Individual Row check, which determines that each row does not contain invalid values. The third is the Row Combination check, which checks for combinations of rows which are not allowed.

Special care is given to links with potential for duplication. If both ANODE-BNODE and BNODE-ANODE are present in the base link set, then neither of their direction flags should ever be set to 2 or 3.

Primary Key Check

  • Duplicate TIPID + ABB combinations are not allowed: Each combination of TIPID + ABB must be unique, as a link is only allowed to be in single state after a project is applied. If there are duplicates, the USE field is set to 0 until the table is changed for it to be unique.

Individual Row Check

Any violation of these will result in the USE field being set to 0.

  • Each TIPID must reference a project in the hwyproj table.
  • Each ABB must reference an ABB in the hwynet/hwynet_arcs feature class.
  • Rows must not violate domains: all attributes must conform to the domains described in Highway Data.
  • Skeleton links must have ACTION_CODE = 4 applied to them: conversely, regular links must have either action 1 or 3 applied to them.
  • Links with ACTION_CODE = 3 must have all 0s: there cannot be unusable attribute values on delete links (ACTION_CODE = 3).
  • NEW_TOLLDOLLARS should be valid: it should either be a decimal or a string of eight decimals.
  • Links with ACTION_CODE = 4 must have required attributes filled in: NEW_DIRECTIONS, NEW_TYPE1, NEW_AMPM1, NEW_THRULANES1, NEW_THRULANEWIDTH1, and NEW_MODES should always be filled in. NEW_TYPE1 will determine if NEW_POSTEDSPEED1 is needed.
  • Links with NEW_DIRECTIONS = 1 or 2 should not have unusable '2' attributes: This is true no matter if the action is 1 or 4.
  • Links with NEW_DIRECTIONS = 3 should have all required '2' attributes filled in: This is true no matter if the action is 1 or 4. NEW_TYPE2 will determine if NEW_POSTEDSPEED2 is needed.
  • Links with potential to become duplicates cannot have NEW_DIRECTIONS > 1: if both ANODE-BNODE and BNODE-ANODE exist in the base links, then they are not allowed to become bidirectional.
  • Coding should not be applied to centroid connectors.

Finally, a violation of these will result in warnings:

  • Links with ACTION_CODE = 1 should not have all 0s: If all the attributes are 0, then it isn't doing anything. This is let off with a warning because it's harmless, but it should be reviewed at some point.

Row Combination Check

A violation of these will result in warnings:

  • Links which have multiple actions applied on it in one year should be reviewed: for example, if a link has 2 actions applied in 2028, where one action sets the # of lanes to 2 and the other sets it to 3, this conflict should be resolved.
  • If a skeleton link does not have any project associated with it, this should be reviewed: these 'dead' skeleton links are marked in the highway link feature class.
Clone this wiki locally