Skip to main content

Tools to derive HUC-cropped DEMs from common DEM datasets

Project description

DEM to basin preprocessing

This preprocessing library takes source 1-meter digital elevation model (DEM) data and splits, crops, buffers, and reprojects it to individual hydrologic basins (identified by their unique identifier, the "HUC12" ID).

This preprocessing script also produces ancillary data products corresponding to each new HUC12 DEM raster to describe their sub-basins (ie "catchments"), their streams (ie "flowlines"), and the roughness of each streambed.

Taken together, these are the major inputs needed to run GeoFlood, which creates short-term flood projections.

Alpha-release Python library

The underlying Python library is available on PyPi and can be installed by:

pip install dem2basin

Main Python script

The recommended way to run dem2basin.py:

python3 dem2basin.py \
    --shapefile study_area_polygon.shp \
    --huc12 WBD-HUC12s.shp \
    --nhd NHD_catchments_and_flowlines.gdb/ \
    --raster TNRIS-LIDAR-Datasets/ \
    --availability TNRIS-LIDAR-Dataset_availability.shp \
    --directory HUC12-DEM_outputs/ \
    --restart dem2basin-study_area.pickle

Required source data inputs

There are 5 required inputs.

Optional parameters

  • --directory Outputs directory: a directory to store outputs, which will each be sorted by HUC12
  • --restart Restart file: a Python Pickle file from which you can restart the preprocessing if it's interrupted
  • --overwrite Overwrite flag: optional flag to overwrite all files found in output directory
  • --overwrite_rasters Overwrite rasters flag: optional flag to overwrite just the raster outputs
  • --overwrite_flowlines Overwrite flowlines flag: optional flag to overwrite just the flowline outputs
  • --overwrite_catchments Overwrite catchments flag: optional flag to overwrite just the catchment outputs
  • --overwrite_roughnesses Overwrite roughness table flag: optional flag to overwrite the roughness table
  • --log Log file: a file to store runtime log

Description of outputs

There are 4 outputs per HUC12.

  • Cropped & buffered DEM:
    • buffered 500m
    • cropped to each HUC12 intersecting the study area
    • at least 1m resolution
    • mosaicked with preference for lowest resolution tiles
    • reprojected to the study area's projections
  • corresponding NHD MR flowlines:
    • subset of NHD MR flowlines
    • each flowline's median point along the line lies within the HUC12
    • reprojected to the study area's projections
  • corresponding NHD MR catchments:
    • subset of NHD MR catchments
    • correspond with the NHD MR flowlines above
    • reprojected to the study area's projections
  • Manning's n roughness table:
    • organized by flowline using their ComIDs
    • vary by stream order

Here is an example of these outputs, originally visualized by Prof David Maidment. Example outputs

Already preprocessed DEMs

Already preprocessed DEMs are now available for the vast majority of Texas's HUC12s if you are a TACC user. You can request a TACC account here.

Notes about preprocessed DEMs

  • The DEMs are not provided for any HUC12s that have any gap in 1m resolution data.
  • All of the DEMS are reprojected to WGS 84 / UTM 14N, even if the HUC12 is outside of UTM 14.

Where to find them

The DEMs are located on Stampede2 at /scratch/projects/tnris/dhl-flood-modelling/TX-HUC12-DEM_outputs.

If you run into trouble

Please submit a ticket if you have trouble accessing this data. You may also contact me directly at @dhardestylewis or dhl@tacc.utexas.edu

Available preprocessed HUC12s

These HUC12 DEMs are available right now on Stampede2. Available HUC12 DEMs

Confirmed successfully preprocessed HUC12s

These HUC12 DEMs have been successfully preprocessed in the past, and will soon be available once again on Stampede2. If you need any of these right now, please contact me. Confirmed HUC12 DEMs

Preprocessing workflow

If you would like an understanding of the preprocessing workflow, I provide a simplified but representative example in this Jupyter notebook. This Jupyter notebook was presented at the inaugural TACC Institute on Planet Texas 2050 Cyberecosystem Tools in August, 2020. Please contact me if you would like a recording.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dem2basin-0.9.0.1.tar.gz (38.2 kB view hashes)

Uploaded Source

Built Distribution

dem2basin-0.9.0.1-py3-none-any.whl (35.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page