Dataset Reference¶
pywmp.datasets provides automated downloaders for all spatial inputs required by a watershed model.
DatasetManager¶
The DatasetManager controls the download order, caching, and summary of downloaded files.
Basic usage¶
from pywmp.datasets import DatasetManager
dm = DatasetManager(
aoi=(-81.700, 27.850, -81.500, 27.950),
output_dir="data/my_watershed",
)
dm.download_dem(resolution_m=10)
dm.download_watershed(huc_level=12)
dm.download_nhd()
dm.download_nlcd(year=2021)
dm.download_soils()
dm.download_cn()
dm.download_atlas14(lat=27.9, lon=-81.6)
dm.download_floodzone()
print(dm.summary())
Datasets supported¶
download_dem()— USGS 3DEP DEM data at selectable resolutiondownload_watershed()— USGS Watershed Boundary Dataset (WBD)download_nhd()— NHD flowlines and catchment polygonsdownload_nlcd()— NLCD land cover rasterdownload_soils()— USDA SSURGO soil and HSG raster datadownload_cn()— derive a curve number raster from NLCD + SSURGOdownload_atlas14()— NOAA Atlas 14 IDF curves for a point locationdownload_floodzone()— FEMA NFHL flood zone polygons
Workflow notes¶
- Download the DEM first. Many other dataset downloaders use the DEM footprint or AOI geometry.
- Download NLCD and soils before calling
download_cn(). download_all()runs all supported downloaders in a sensible sequence.
Output files¶
The dataset manager writes files into output_dir. Typical outputs include:
dem.tifwatershed.gpkgnhd_flowlines.gpkgnhd_catchments.gpkgnlcd.tifsoils.tifcn.tifatlas14_idf.jsonfloodzone.gpkg
Troubleshooting downloads¶
- If a dataset is not available for the AOI, try a nearby location or a larger AOI.
- If download requests fail, check internet access and firewall settings.
- For large AOIs, use coarser DEM resolution and download data incrementally.