bakaano.dem

Digital elevation model (DEM) download and preprocessing.

Role: Provide clipped DEM and derived slope for the study area.

class bakaano.dem.DEM(working_dir, study_area, local_data=False, local_data_path=None)[source]

Bases: object

compute_slope_percent_riserun()[source]

Compute slope (percent rise/run) from the clipped DEM.

Returns:

None. Writes slope_clipped.tif to {working_dir}/elevation.

get_dem_data()[source]

Download or ingest DEM data and clip to the study area.

If local_data is False, downloads HydroSHEDS 30s DEM and clips it. If local_data is True, clips the provided local GeoTIFF.

Returns:

None. Writes dem_clipped.tif to {working_dir}/elevation.

plot_dem()[source]

Plot the clipped DEM within the study area.

Returns:

None. Displays a matplotlib plot.

preprocess()[source]

Clip the DEM and derive slope output if missing.

Returns:

None. Writes dem_clipped.tif and slope_clipped.tif.