Utility Process NHD For EnviroAtlas Analyses - USEPA/ATtILA2 GitHub Wiki

Process NHD for EnviroAtlas Analysis

Summary

Process the National Hydrography Dataset's (NHD) Flowline, Waterbody, and Area features to produced the linear and areal stream features used in producing EnviroAtlas metrics such as the Percent Forest and Woody Wetlands in Stream Buffer metric (Fact Sheet).

The tool allows you to process either a single or multiple geodatabases, as well as a single or multiple folders of shapefiles.

NOTE: The NHD High Resolution (NHD), NHDPlus High Resolution (NHDPlus HR) datasets are available from https://www.usgs.gov/national-hydrography/access-national-hydrography-products.

NOTE: The NHDPlus Version 2 datasets are available at https://nhdplus.com/NHDPlus/NHDPlusV2\_home.php.

Usage

  • WARNING: This tool will ignore the geoprocessing's 'Allow geoprocessing tools to overwrite existing datasets' setting and overwrite generated outputs.

  • NOTE: Enabling the Parallel Processing Factor environment can improve computation time for several ATtILA tools, but we have detected, on rare occasions, doing so can lead to spurious results. As a precaution, ATtILA will disable the Parallel Processing Factor environment for this tool. We hope to return this choice to the user once the impact on operational speed and accuracy of swapping geoprocessing tools with their pairwise counterparts has been assessed.

  • A list of one or more NHD workspaces to process will be generated depending on the selection in the Process single or multiple files and its enabled secondary parameters:

    • Single geodatabase
      • The NHD workspace list will consist of the name of the selected geodatabase file in the Single geodatabase file parameter.
      • The geodatabase must have a Hydrography feature dataset containing the feature classes, NHDFlowline, NHDWaterbody, and NHDArea.
    • Multiple geodatases
      • The NHD workspace list will consist of each name of the geodatabases in the Geodatabase folder where a Hydrography feature dataset with the feature classes, NHDFlowline, NHDWaterbody, and NHDArea are found. The search is limited to geodatabases in the Geodatabase folder that match the expression in the Geodatabase file filter.
    • Single shapefile
      • The NHD workspace list will consist of the name of the folder selected in Single shapefile folder. The files, NHDFlowline.shp, NHDWaterbody.shp, and NHDArea.shp can exist either in that folder or one of its subfolders.
      • WARNING: If more than one subfolder exists with the NHD files in the Single shapefile folder, all of the subfolders will be processed, but the outputs will be overwritten with each successive iteration.
    • Multiple shapefiles
      • The NHD workspace list will consist of the name of each child subfolder in the Multiple shapefiles folder where the files, NHDFlowline.shp, NHDWaterbody.shp, and NHDArea.shp are found either in the child subfolder or within one of their subfolders. The search is limited to the child subfolders in the Multiple shapefiles folder that match the expression in the Shapefile folder filter.
  • Three generated layers are produced for each entry in the NHD workspace list:

    • [NHD Workspace Name]_strmLinesNAP - NHDFlowline layer features with ftypes equal to StreamRiver or Connector. NAP stands for 'No Artificial Paths'.

    • [NHD Workspace Name]_strmLines - NHDFlowline layer features with ftypes equal to StreamRiver, Connector, or Artificial Paths.

    • [NHD Workspace Name]_strmAreal - StreamsRivers, Rapids, Lock Chambers from the NHDArea layer. Washes from the NHDArea layer that are within 1 meter of the derived strmLine layer. Reservoir, LakePond, and Ice Mass features from the NHDWaterbody layer that are within 1 meter of the derived strmLines or within 1 meter of the derived strmLine end nodes.

  • For each entry in the NHD workspace list, the following operations are performed:

    • Create layer for NHDFlowline.
    • Select from NHDFlowline layer features with ftypes equal to StreamRiver or Connector.
    • Copy selected features to output feature class. The suffix, "_strmLineNAP", will be appended to the filename.
    • Add NHDFlowline features with ArtificialPath ftype to the selected StreamRiver and Connector features.
    • Copy selected NHDFlowline features to output feature class. The suffix, "_strmLine", will be appended to the filename.
    • Find line ends for selected NHDFlowline features.
    • Use NEAR to calculate distances between line ends.
    • Select nodes where the NEAR_DIST value <> 0. These are the terminal nodes.
    • Copy terminal nodes to intermediate output feature class. The suffix, "_strmEnds", will be appended to the filename.
    • Create layer for NHDArea.
    • Select from NHDArea layer features where the ftype = Wash.
    • Reduce the selected Washes to just those that are within 1 Meter of selected NHDflowlines.
    • Add NHDArea features with ftypes equal to StreamRiver, Rapids, or Lock Chamber features to the selected Washes.
    • Create layer for NHDWaterbody.
    • Select from NHDWaterbody layer features with ftype equal to Reservoir, LakePond, or Ice Mass.
    • Reduce the selected NHDWaterbody features to just those that are within 1 Meter of selected NHDflowlines.
    • Merge the selected NHDArea features with the selected NHDWaterbody features.
    • Add field, "tmp_diss", to the merged feature class attribute table and set its value to 1.
    • Dissolve the merged feature class using the "tmp_diss" field.
    • Perform a second dissolve on the dissolved feature class using the "tmp_diss" field.
    • Create layer for the merged and dissolved areal feature class.
    • Select from the merged and dissolved areal feature class, features that are within 1 Meter of derived terminal nodes.
    • Add to those features any additional merged and dissolved areal features that intersect the selected NHDFlowlines.
    • Copy selected merged and dissolved areal features to output feature class. The suffix, "_strmAreal", will be appended to the filename.
  • In Additional Options, the user may elect to Retain Intermediate Layers Generated During Metric Processing.

    • Choosing to Retain Intermediate Layers saves the intermediate products to one of the following locations:

      • When Output workspace is a geodatabase, intermediate products are placed in the same file geodatabase.

      • When Output workspace is a file folder, intermediate products are placed in the same file folder.

  • Generated intermediate layers produced are:

    • [NHD Workspace Name]_strmEnds - Terminal nodes (i.e., nodes touching only one line segment) for each stream in [NHD Workspace Name]_strmLine. All of the attributes of the adjacent stream segment are available.

Syntax

PNHD (Single_or_multiple_files, Geodatabase_file, Geodatabase_folder, Geodatase_file_filter, Single_shapefile_folder, Multiple_shapefiles_folder, Shapefile_folder_filter, Output_workspace, {Select_options})

Parameter Explanation Data Type
Single_or_multiple_files Type and quantity of input NHD feature datasets to process: single or multiple, shapefiles or geodatabases. String
Geodatabase_file The path to the NHD geodatabase.

The geodatabase must have a Hydrography feature dataset containing the feature classes, NHDFlowline, NHDWaterbody, and NHDArea.
Workspace
Geodatabase_folder The path to the folder containing multiple NHD geodatabases.

Geodatabases within this folder that contain a Hydrography feature dataset with the feature classes: NHDFlowline, NHDWaterbody, and NHDArea, will be identified as NHD workspaces and their names will be used as output filename bases.

The optional wildcard expression in the Geodatabase file filter parameter can be used to limit the geodatabases searched in the Geodatabase folder.
Workspace
Geodatabase_file_filter Wildcard expression used to limit searched geodatabases within the Geodatabase folder for NHD workspaces.

Use a single asterisk character (*) to search all geodatabases.
String
Single_shapefile_folder The path to the NHD shapefile folder.

The folder name will be used as the output filename base. The files, NHDFlowline.shp, NHDWaterbody.shp, and NHDArea.shp, can exist in this folder or one of its subfolders.
Workspace
Multiple_shapefiles_folder The path to the folder containing one or more NHD shapefile folders.

Folders within this folder that contain the files: NHDFlowline.shp, NHDWaterbody.shp, and NHDArea.shp, directly or in one of their subfolders, will be identified as NHD workspaces and their names will be used as output filename bases.

The optional wildcard expression in the Shapefile folder filter parameter can be used to limit the subfolders searched in the Multiple shapefiles folder.
Workspace
Shapefile_folder_filter Wildcard expression used to limit searched subfolders within the Multiple shapefiles folder for NHD workspaces.

Use a single asterisk character (*) to search all subfolders.
String
Output_workspace The path to the Output workspace.

If the Output workspace is a file folder, new layers will be saved as shapefiles. If the Output workspace is a geodatabase, new layers will be saved as geodatabase feature classes.
Workspace
Select_options (Optional) One tool option is available to provide additional information:

  • Retain Intermediate Layers Generated During Metric Calculation - Saves the intermediate data layers that are normally deleted after processing is complete.
Multiple Value

Credits

Use limitations

There are no access and use limitations for this item.


arrow_up Top of the page     |     arrow_left Process NAVTEQ for EnviroAtlas Analyses     |     arrow_right Land Cover Classification


⚠️ **GitHub.com Fallback** ⚠️