Processing API
The processing module contains functions for processing DEMs and extracting hydro-topographic features.
Processing modules for hydro-topological features.
- burn_streams(site_id: str, raw_dem: str, osm_water_raster: str, output_dirs: Dict[str, Path]) str[source]
Burn streams into the DEM for improved hydrological modeling.
- Parameters:
site_id – Unique identifier for the site
raw_dem – Path to raw DEM
osm_water_raster – Path to rasterized water features
output_dirs – Dictionary of output directories
- Returns:
Path to burned DEM
- get_edtw(site_id: str, osm_water_raster: str, output_dirs: Dict[str, Path]) str[source]
Compute Euclidean Distance to Water (EDTW).
- Parameters:
site_id – Unique identifier for the site
osm_water_raster – Path to rasterized water features
output_dirs – Dictionary of output directories
- Returns:
Path to EDTW raster
- get_osm_hand(site_id: str, raw_dem: str, osm_water_raster: str, burned_dem: str, output_dirs: Dict[str, Path]) str[source]
Compute Height Above Nearest Drainage (HAND) using OSM water features.
- Parameters:
site_id – Unique identifier for the site
raw_dem – Path to raw DEM
osm_water_raster – Path to rasterized water features
burned_dem – Path to burned DEM
output_dirs – Dictionary of output directories
- Returns:
Path to HAND raster
- get_slope(site_id: str, raw_dem: str, output_dirs: Dict[str, Path]) str[source]
Compute slope from DEM.
- Parameters:
site_id – Unique identifier for the site
raw_dem – Path to raw DEM
output_dirs – Dictionary of output directories
- Returns:
Path to slope raster
- prepare_input_data(site_id: str, aoi_path: str, dem_tile_folder_path: str, output_dirs: Dict[str, Path]) Dict[str, str][source]
Prepare input data for hydro-topological feature extraction.
This function performs the following steps: 1. Merges DEM tiles into a single DEM 2. Extracts water features from OpenStreetMap 3. Rasterizes water features to match DEM resolution
- Parameters:
site_id – Unique identifier for the site
aoi_path – Path to AOI shapefile/geopackage
dem_tile_folder_path – Path to folder containing DEM tiles
output_dirs – Dictionary of output directories
- Returns:
Dictionary of output paths (raw_dem, osm_water_vector, osm_water_raster)
Prepare Data
Functions for preparing input data for hydro-topological feature extraction.
- extract_osm_water_features(aoi_path: str, output_path: Path, dem_path: str) None[source]
Extract water features from OpenStreetMap within the AOI.
- Parameters:
aoi_path – Path to AOI shapefile/geopackage
output_path – Path to output water features
dem_path – Path to DEM for grid initialization
- merge_dem_tiles(dem_tile_folder_path: str, output_path: Path) None[source]
Merge multiple DEM tiles into a single DEM.
- Parameters:
dem_tile_folder_path – Path to folder containing DEM tiles
output_path – Path to output merged DEM
- prepare_input_data(site_id: str, aoi_path: str, dem_tile_folder_path: str, output_dirs: Dict[str, Path]) Dict[str, str][source]
Prepare input data for hydro-topological feature extraction.
This function performs the following steps: 1. Merges DEM tiles into a single DEM 2. Extracts water features from OpenStreetMap 3. Rasterizes water features to match DEM resolution
- Parameters:
site_id – Unique identifier for the site
aoi_path – Path to AOI shapefile/geopackage
dem_tile_folder_path – Path to folder containing DEM tiles
output_dirs – Dictionary of output directories
- Returns:
Dictionary of output paths (raw_dem, osm_water_vector, osm_water_raster)
Burn DEM
Functions for burning streams into DEMs.
- burn_streams(site_id: str, raw_dem: str, osm_water_raster: str, output_dirs: Dict[str, Path]) str[source]
Burn streams into the DEM for improved hydrological modeling.
- Parameters:
site_id – Unique identifier for the site
raw_dem – Path to raw DEM
osm_water_raster – Path to rasterized water features
output_dirs – Dictionary of output directories
- Returns:
Path to burned DEM
Derive Products
Functions for computing hydro-topological features.
- get_edtw(site_id: str, osm_water_raster: str, output_dirs: Dict[str, Path]) str[source]
Compute Euclidean Distance to Water (EDTW).
- Parameters:
site_id – Unique identifier for the site
osm_water_raster – Path to rasterized water features
output_dirs – Dictionary of output directories
- Returns:
Path to EDTW raster
- get_osm_hand(site_id: str, raw_dem: str, osm_water_raster: str, burned_dem: str, output_dirs: Dict[str, Path]) str[source]
Compute Height Above Nearest Drainage (HAND) using OSM water features.
- Parameters:
site_id – Unique identifier for the site
raw_dem – Path to raw DEM
osm_water_raster – Path to rasterized water features
burned_dem – Path to burned DEM
output_dirs – Dictionary of output directories
- Returns:
Path to HAND raster
- get_slope(site_id: str, raw_dem: str, output_dirs: Dict[str, Path]) str[source]
Compute slope from DEM.
- Parameters:
site_id – Unique identifier for the site
raw_dem – Path to raw DEM
output_dirs – Dictionary of output directories
- Returns:
Path to slope raster
Functions:
get_osm_hand: Compute Height Above Nearest Drainage (HAND) using OSM water featuresget_slope: Compute slope from DEMget_edtw: Compute Euclidean Distance to Water (EDTW)