{"id":29886071,"url":"https://github.com/pauldzy/nhdplus_navigation_ndm","last_synced_at":"2026-02-09T16:02:08.378Z","repository":{"id":87325506,"uuid":"59374617","full_name":"pauldzy/NHDPlus_Navigation_NDM","owner":"pauldzy","description":"Alternative Prototype using Oracle Network Data Model for Stream Navigation","archived":false,"fork":false,"pushed_at":"2020-12-21T00:14:27.000Z","size":42,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-31T18:32:42.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pauldzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-05-21T18:06:00.000Z","updated_at":"2020-12-21T00:14:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c7e28a2-f040-4a6f-b0a5-287a023ac5df","html_url":"https://github.com/pauldzy/NHDPlus_Navigation_NDM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pauldzy/NHDPlus_Navigation_NDM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pauldzy%2FNHDPlus_Navigation_NDM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pauldzy%2FNHDPlus_Navigation_NDM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pauldzy%2FNHDPlus_Navigation_NDM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pauldzy%2FNHDPlus_Navigation_NDM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pauldzy","download_url":"https://codeload.github.com/pauldzy/NHDPlus_Navigation_NDM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pauldzy%2FNHDPlus_Navigation_NDM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29271854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-31T16:23:02.886Z","updated_at":"2026-02-09T16:02:08.361Z","avatar_url":"https://github.com/pauldzy.png","language":"PLSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NHDPlus Navigation using Oracle NDM\n#### An alternative prototype using [Oracle Network Data Model](https://docs.oracle.com/en/database/oracle/oracle-database/21/topol/network-data-model-graph-overview.html#GUID-D34F1A0C-4D9B-4185-B965-43B218D3F382) for stream navigation.\n\nThe [National Hydrology Dataset Plus](https://www.epa.gov/waterdata/nhdplus-national-hydrography-dataset-plus) has provided [an engine](https://www.epa.gov/waterdata/learn-more#vaa) for stream navigation for almost two decades.  This engine subsequently was ported into Oracle about 12 years ago and provided as public service as an [EPA Office of Water service](https://www.epa.gov/waterdata/navigation-service).  See [this codepen](http://codepen.io/pauldzy/pen/LVoBpj) to view the current EPA service in action.\n\nThe existing engine predates the release of modern network and graph analysis tools and there may be some concern regarding the scaleability of the current (v1) engine.  First undertaken around 2014, this project rewrites the navigation logic using the [Oracle Network Data Model](https://docs.oracle.com/en/database/oracle/oracle-database/21/topol/network-data-model-graph-overview.html#GUID-D34F1A0C-4D9B-4185-B965-43B218D3F382) and in fact fails in its ultimate goal of replacing the old Navigation engine due to [problematic Java heap memory management](https://community.oracle.com/tech/apps-infra/discussion/3722944/sdo-net-tracein-and-traceout-features-or-bugs) and other logic limitations within NDM.  While it is possible this situation may one day be corrected by Oracle, the NDM navigation logic functions well for smaller scale navigation tasks and can be used for head-to-head testing and QA duties with both the old navigator and future implementations of NHDPlus navigation.\n\n## Setup\n\nThe logic has been tested in both Oracle 11g, 12g and 18c without noticeable difference in performance or functionality.\n\nThe navigation logic requires the NHDPlus flowline network to be converted into two [NDM graphs](https://docs.oracle.com/en/database/oracle/oracle-database/21/topol/network-data-model-graph-overview.html#GUID-4D127E98-2856-4C90-9FE0-BCA156E39C7C) - one based on flowline length (km) and the other on flowline flowtime (days).  The **network_builder** package has procedures to create a network in a NHDPLUS_TOPONET schema.  The source NHDPlus flowline and plusflow resources may be requested from EPA via their waters_support@epa.gov helpline or created from [the source NHDPlus data downloads](https://www.epa.gov/waterdata/get-data#Download) by hand.\n\nWith the network in place, build the preprocessing and temporary tables using the **build_preprocessing_tables** and **build_temporary_tables** procedures and then run the **navigate** procedure by inspecting the inline documentation.  If you are more interested in the end results, there are working examples running on EPA servers identified as version 2 of navigation you can [view here](https://codepen.io/pauldzy/pen/BajBpzo).\n\n## Limitations\n\nNHDPlus Navigation via NDM fails primarily in two use cases, large Upstream with Tributaries and any Downstream with Divergences navigation.  \n\nFor the former the reason is fairly simple, NDM marshals navigation results in memory.  Thus you can navigation only for much PGA memory your database session has.  One would not think the average NDM link would require much memory, but large continent spanning navigation will fail with memory errors.  This is despite code attempts to maximum the Java heap.  For typical use cases running 10 to 50 miles upstream it works fine.  In theory with enough memory this is would not be a problem.  \n\nFor the latter situation the problem is tied to how Downstream with Divergences distance and flowtime tallys work or rather don't work with the NDM system.  When we navigate downstream with divergences, the proper method to determine NHDPlus costs is to first calculate the costs on the mainstem.  Then for each divergence calculate it's mainstem cost starting with the cost value at the top from the mainstem.  Then for any divergence off that divergence get its parent main stem costs iteratively until all divergences are calculated. For divergences that loop back into the mainstem, sometimes they are longer than the mainstem or they may well be shorter - such is natural hydrography.  I cannot find a way to prioritize the mainstem within the bounds of Oracle NDM.  There seems no way to control the internal routing logic of which branch to follow to drive costing.  NDM **always** follows the lowest cost routing with that route generating tallied costs.  Altering the costs to drive the prioritization would then bork the cost for knowing when to stop.  Its possible there is a clever solution for this problem but six years on I have not found it.  Any solution or suggestions are **always** appreciated.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpauldzy%2Fnhdplus_navigation_ndm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpauldzy%2Fnhdplus_navigation_ndm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpauldzy%2Fnhdplus_navigation_ndm/lists"}