Skip to content

finalize_hwy_data()

ccai-cmap edited this page Oct 15, 2025 · 16 revisions

finalize_hwy_data() ensures that all the highway files (link fc, node fc, project fc, project table) conform to the schema described in Highway Data.

  1. hwynet/hwynet_arc drops links where BASELINK = 1 and NEW_BASELINK = 0, as this indicates that links have been deleted. BASELINK is then set to NEW_BASELINK and the ABB is recalculated. This will only have an effect when the base year is updated.
  2. hwynet/hwynet_node drops extra nodes which do not have a connection to any links. This will only have an effect when the base year is updated.
  3. hwyproj_coding drops all rows with USE = 0 and updates ABB to match NEW_BASELINK.
  4. hwynet/hwyproj is redissolved with the rows of hwyproj_coding which were kept. Due to the geospatial gymnastics involved this takes a while.

The extra fields added in create_base_hwy() are dropped, and add_rcs() is called to add the relationship classes back into the geodatabase.

As long as the data we started with was good, and conformed to what was described in Highway Data, the algorithms applied should not result in any errors or deviations from the schema. So, for example, if you updated the base year to 2020 and hit finalize, MHN_2020.gdb should pass both check_hwy_fcs() and check_hwyproj_coding_table().

TODO: make a csv of dropped nodes + make a csv of dropped projects!

Clone this wiki locally