Skip to content

Add column that indicates if a flowline has a catchment polygon #425

@jds485

Description

@jds485

I recently wanted to plot all the NHDPlus v2.1 flowlines that do not have catchment polygons, and needed to load in the flowline and catchment datasets to do that. I think it would be helpful to create a new column in the flowline data table with this information (no_catchment below). You could also list the polygon ID number instead of a binary TRUE/FALSE.

#flowlines
flines <- sf::st_read('NHDPlusV21_NationalData_Seamless_Geodatabase_Lower48_07/NHDPlusNationalData/NHDPlusV21_National_Seamless_Flattened_Lower48.gdb', 
                      layer = 'NHDFlowline_Network')

#catchments
catchments <- sf::st_read('NHDPlusV21_NationalData_Seamless_Geodatabase_Lower48_07/NHDPlusNationalData/NHDPlusV21_National_Seamless_Flattened_Lower48.gdb', 
                       layer = 'Catchment')

flines$no_catchment <- TRUE
flines[which(flines$COMID %in% catchments$FEATUREID), 'no_catchment'] <- FALSE

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions