Hi, I'm an error. x

Create Level-12 Hydrological Unit Code (HUC) selection list

Authors: Lorne Leonard
Owners: Lorne Leonard
Resource type:Script Resource
Created:Jul 27, 2017 at 3:19 p.m.
Last updated: Jul 28, 2017 at 8:26 p.m. by Lorne Leonard


This script generates an XML file containing up or down stream Level-12 HUCs from a user specified HUC anywhere in the Contiguous United States (CONUS).

Briefly, the resultant XML file contains the following information:
[1] "WhereStrings" for selecting HUCs within the National Hydrography Dataset (NHD) using SQL in ArcMap or QTGIS.
[2] Location of stream outlets "Intersection Points" between Level-12 HUCs.
[3] A list of Closed Basins within the graph hierarchy.
[4] A list of NLDAS cell ids for forcing selection.
[5] Graph selection lists using DFS, BFS and undirected Dijkstra graphs. With distances to CONUS Level-12 HUCs.

"-i", "--huc12id" Level-12 HUC numerical identification i.e. 020502040102 for Slab Cabin Run
"-r", "--reverse" Reverse selection i.e. false (default) selects upstream, true indicates downstream
"-o", "--ofolder" Output folder location

Example usage
[Windows]: python.exe get_HUC_Graph.py -i 020502040102 -r false -o c:\
[Ubuntu]: python3 get_HUC_Graph.py -i 020502040102 -r false -o \tmp

Further information is available here:

Subject Keywords


How to cite

Leonard, L. (2017). Create Level-12 Hydrological Unit Code (HUC) selection list, HydroShare, http://www.hydroshare.org/resource/17989100a014401ea19d90848354418a

This resource is shared under the Creative Commons Attribution CC BY.


Sharing status:

  • Public Resource  Public
  • Sharable Resource  Shareable


Download All Content as Zipped BagIt Archive
Learn more about the Bagit archive format


The people or organizations that created the intellectual content of the resource.

Name Organization Address Phone Author Identifiers
Lorne Leonard The Pennsylvania State University
Programming Language Python
Programming Language Version Python 3
Script Version 1.0
Script Dependencies
Release Date
Script Repository


Be the first one to  +1 this.  (You need to be logged in to rate this.)


There are currently no comments

New Comment