Supporting data for the MassWateR R package, includes simplified NHD datasets to support the anlzMWRmap()
function.
See R/dat_proc.R for creating RData objects used by MassWateR.
Create simplified shapefiles
- Get NHDFlowline, NHDWaterbody, and NHDArea layers for Massachusetts, Vermont, and New Hampshire.
- Clip Vermont layers with the WBDHU4 Connecticut River watershed.
- Clip New Hampshire layers with WBDHU4 Merrimack River watershed.
- Merge MA, VT, NH for each layer type.
- In NHDWaterbody layer, change visibility for Long Island Sound to 1,000,000
- Filter NHDFlowlines to fcode 46006 and visibility > 100,000
- Filter NHDWaterbody to ftypes 390 and 493 and visibility > 100,000
- No filter needed for NHDArea
- Export each layer to new layer (with fields ObjectID, fdate, fcode, ftype, visibility)
- Delete duplicate geometries in each layer
- Remove extra ponds from Waterbody layer (see note about middle CT River watershed below)
- Add pond_area field in m2
- Select by location waterbodies within CTWatershed_waterbody_correction polygon
- Filter within selection waterbodies with pond_area less than 10,000 m2
- Create a temporary clipped layer of Flowlines that intersect the correction polygon (improves performance of next step)
- Remove from selection by location all waterbodies that touch Flowlines
- Invert selection and export layer
- Add dLevel field per logic below
- Simplify all layers to 10 meters
- Zip the three sets of shapefiles together
Logic for NHD dLevels
NHDArea -- dLevel = 'low'
NHDWaterbody and NHDFlowline:
- If visibility < 500,000 then dLevel = 'high'
- If visibility >= 500,000 then dLevel = 'medium'
- If visibility >= 1,000,000 then dLevel = 'low'
- Code: if("visibility" >= 1000000,'low', if("visibility" >= 500000, 'medium', 'high'))
In the middle CT River watershed, there is a large area where visibility is set to 5,000,000 for all small ponds in the Waterbody layer. This needs to be corrected as follows:
- Filter NHDWaterbody for dLevel = 'low' and pond_area <= 300,000 m2
- Code: "dLevel" = 'low' AND "pond_area" <= 300000
- Select waterbodies by location within CTWatershed_waterbody_correction polygon
- Filter NHDFlowline to 'low' (use temporary clipped Flowline layer)
- Code: "dLevel" = 'low'
- Remove from selection by location all waterbodies that touch Flowlines
- Change dLevel to 'medium' for selected waterbodies
- Filter NHDWaterbody for dLevel = 'low' and 'medium' and pond_area <= 85,000 m2
- Code: ("dLevel" = 'low' OR "dLevel" = 'medium') AND "pond_area" <= 85000
- Select waterbodies by location within CTWatershed_waterbody_correction polygon
- Filter NHDFlowline to 'low' and 'medium' (use temporary clipped Flowline layer)
- Code: "dLevel" = 'low' OR "dLevel" = 'medium'
- Remove from selection by location all waterbodies that touch Flowlines
- Change dLevel to 'high' for selected waterbodies
Here is a link to the NHD ftype and fcode definitions. https://nhd.usgs.gov/userGuide/Robohelpfiles/NHD_User_Guide/Feature_Catalog/Hydrography_Dataset/Complete_FCode_List.htm