Skip to content

Commit

Permalink
Adding check for NWM stream segments within HUC boundaries
Browse files Browse the repository at this point in the history
This merge modifies clip_vectors_to_wbd.py to check for relevant input data.

- clip_vectors_to_wbd.py now checks that there are NWM stream segments within the buffered HUC boundary.
- included_huc8_ms.lst has several additional HUC8s.
  • Loading branch information
BrianAvant authored Aug 18, 2021
1 parent 40a5a4c commit 7aa4ab9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ All notable changes to this project will be documented in this file.
We follow the [Semantic Versioning 2.0.0](http://semver.org/) format.
<br/><br/>

## v3.0.20.2 - 2021-08-13 - [PR #443](https://github.com/NOAA-OWP/cahaba/pull/443)

This merge modifies `clip_vectors_to_wbd.py` to check for relevant input data.

## Changes
- `clip_vectors_to_wbd.py` now checks that there are NWM stream segments within the buffered HUC boundary.
- `included_huc8_ms.lst` has several additional HUC8s.

<br/><br/>

## v3.0.20.1 - 2021-08-12 - [PR #442](https://github.com/NOAA-OWP/cahaba/pull/442)

This merge improves documentation in various scripts.
Expand Down
6 changes: 5 additions & 1 deletion src/clip_vectors_to_wbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ def subset_vector_layers(hucCode,nwm_streams_filename,nhd_streams_filename,nwm_l
nwm_streams = gpd.read_file(nwm_streams_filename, mask = wbd_buffer)
if extent == 'MS':
nwm_streams = nwm_streams.loc[nwm_streams.mainstem==1]
nwm_streams.to_file(subset_nwm_streams_filename,driver=getDriver(subset_nwm_streams_filename),index=False)
if len(nwm_streams) > 0:
nwm_streams.to_file(subset_nwm_streams_filename,driver=getDriver(subset_nwm_streams_filename),index=False)
else:
print ("No NWM stream segments within HUC " + str(hucCode) + " boundaries.")
sys.exit(0)
del nwm_streams

if __name__ == '__main__':
Expand Down

0 comments on commit 7aa4ab9

Please sign in to comment.