Riverscapes / riverscapes-tools

Open-source Python 3.0 tools for the Riverscapes organization
https://tools.riverscapes.net/
GNU General Public License v3.0
11 stars 12 forks source link

Build national NHD HUC10 feature class #1026

Closed philipbaileynar closed 2 months ago

philipbaileynar commented 2 months ago

I have been struggling to accurately monitor our CONUS run because I am basing completion off of the WBD HUC10s. These differ from the actual data that we are using for Riverscapes Context.

Please write a Python script to download each HUC4 VPU File Geodatabase (using boto) then use OGR2OGR to "append" the HUC10 layer into a new GeoPackage polygon feature class.

You can use the following boto command to obtain the NHD data from S3:

aws s3 cp s3://prd-tnm/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/NHDPLUS_H_1701_HU4_GDB.zip .

or to list them...

aws s3 ls s3://prd-tnm/StagedProducts/Hydrography/NHDPlusHR/VPU/Current/GDB/ | grep '.*\.zip' > allzips.txt

Then you can adapt the following OGR2OGR command in a single GeoPackage Feature class:

cmd = f'ogr2ogr -f GPKG -makevalid -append  -nln {feature_class} "{output_gpkg_file}" "{input_gpkg_file}" {feature_class}'
subprocess.call([cmd], shell=True, cwd=output_gpkg_dir)

Deliverable

KellyMWhitehead commented 2 months ago

Huc 10 db was provided to @philipbaileynar

huc_conus.py script saved in rs_context scripts for future use.