Skip to content

Read New NHF Schema (NGWPC-9422)#159

Draft
idtodd wants to merge 4 commits intodevelopmentfrom
idt-nhf1-integration
Draft

Read New NHF Schema (NGWPC-9422)#159
idtodd wants to merge 4 commits intodevelopmentfrom
idt-nhf1-integration

Conversation

@idtodd
Copy link

@idtodd idtodd commented Mar 12, 2026

The hydrofabric layout has changed for input geopackages. This update allows NGEN and partitionGenerator to read and work with the new layout.

The NHF change is quite significant (e.g., requiring joins to find destination catchment/nexus IDs and IDs being stored as integers instead of strings). To handle these changes, the SQL query used to extract data will transform the new data into the format of the old format. This means renaming the ID fields from div_id/nex_id to id, casting the ID from an integer to a string and adding cat- or nex- to the front, and joining and renaming the destination ID to a string. The result is a relatively small update to the read function for geopackages and letting the rest of the code stay the same. While this adds technical debt from the NGEN code not looking like the structure of the geopackage, it significantly limits the amount of work needed rework almost every part of NGEN to match the new schema.

Additions

Removals

Changes

  • ngen::geopackage::read function updated to read the geopackage in a way that generates a similar output to the current hydrofabric schema
  • Added better error messaging for catching errors when reading the geopackage

Testing

  1. Successfully generated a partition JSON using partitionGenerator using an example of the new NHF schema.

Screenshots

Notes

  • The realization JSON is still expected to have catchment formulae starting with cat- instead of a string representation of the catchment ID.
  • GeoJSON inputs will still expect cat- and nex- prefixes for representing those features.

Todos

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Testing checklist (automated report can be put here)

Target Environment support

  • Linux

@idtodd idtodd changed the title Idt nhf1 integration Read New NHF Schema (NGWPC-9422) Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant