Skip to content

HmsTerrain

Terrain and extent helpers for TauDEM preprocessing handoff.

hms_commander.HmsTerrain

Terrain-oriented helpers for TauDEM preprocessing.

This module is intentionally small and delegates to HmsHydrologyContext so the shared geometry logic stays in one place.

HmsTerrain

Static terrain helpers for TauDEM preprocessing handoff.

Source code in hms_commander/HmsTerrain.py
class HmsTerrain:
    """Static terrain helpers for TauDEM preprocessing handoff."""

    @staticmethod
    def geometry_bounds(feature_or_geometry: Any):
        """Return bounds for a GeoJSON payload."""
        return HmsHydrologyContext.geometry_bounds(feature_or_geometry)

    @staticmethod
    def recommend_dem_clip_extent(
        feature_or_geometry: Any,
        buffer_fraction: float = 0.05,
        min_buffer_degrees: float = 0.01,
    ) -> Dict[str, Any]:
        """Recommend a padded DEM clip envelope around a reference geometry."""
        return HmsHydrologyContext.recommend_dem_clip_extent(
            feature_or_geometry,
            buffer_fraction=buffer_fraction,
            min_buffer_degrees=min_buffer_degrees,
        )

    @staticmethod
    def build_taudem_handoff(
        gauge_metadata: Optional[Mapping[str, Any]] = None,
        basin_boundary: Optional[Mapping[str, Any]] = None,
        huc_context: Optional[Mapping[str, Any]] = None,
        clip_geometry: Optional[Any] = None,
        buffer_fraction: float = 0.05,
        min_buffer_degrees: float = 0.01,
    ) -> Dict[str, Any]:
        """Build an in-memory TauDEM handoff bundle."""
        return HmsHydrologyContext.build_taudem_handoff(
            gauge_metadata=gauge_metadata,
            basin_boundary=basin_boundary,
            huc_context=huc_context,
            clip_geometry=clip_geometry,
            buffer_fraction=buffer_fraction,
            min_buffer_degrees=min_buffer_degrees,
        )

    @staticmethod
    def derive_boundary_outlet(
        reference_boundary_path,
        stream_network_path,
        *,
        output_path=None,
        seed_outlet_path=None,
        fallback_crs=None,
        study_name: Optional[str] = None,
        workspace_root=None,
        site_id: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Derive a downstream outlet where the main stem crosses the basin boundary."""
        return HmsWatershedVerification.derive_boundary_outlet(
            reference_boundary_path=reference_boundary_path,
            stream_network_path=stream_network_path,
            output_path=output_path,
            seed_outlet_path=seed_outlet_path,
            fallback_crs=fallback_crs,
            study_name=study_name,
            workspace_root=workspace_root,
            site_id=site_id,
        )

    @staticmethod
    def derive_taudem_boundary_outlet(
        stream_network_path,
        *,
        taudem_watershed_raster_path=None,
        taudem_boundary_path=None,
        output_path=None,
        seed_outlet_path=None,
        fallback_crs=None,
        study_name: Optional[str] = None,
        workspace_root=None,
        site_id: Optional[str] = None,
    ) -> Dict[str, Any]:
        """Derive a handoff outlet where the TauDEM main stem crosses the TauDEM basin boundary."""
        return HmsWatershedVerification.derive_taudem_boundary_outlet(
            stream_network_path=stream_network_path,
            taudem_watershed_raster_path=taudem_watershed_raster_path,
            taudem_boundary_path=taudem_boundary_path,
            output_path=output_path,
            seed_outlet_path=seed_outlet_path,
            fallback_crs=fallback_crs,
            study_name=study_name,
            workspace_root=workspace_root,
            site_id=site_id,
        )

geometry_bounds(feature_or_geometry) staticmethod

Return bounds for a GeoJSON payload.

Source code in hms_commander/HmsTerrain.py
@staticmethod
def geometry_bounds(feature_or_geometry: Any):
    """Return bounds for a GeoJSON payload."""
    return HmsHydrologyContext.geometry_bounds(feature_or_geometry)

recommend_dem_clip_extent(feature_or_geometry, buffer_fraction=0.05, min_buffer_degrees=0.01) staticmethod

Recommend a padded DEM clip envelope around a reference geometry.

Source code in hms_commander/HmsTerrain.py
@staticmethod
def recommend_dem_clip_extent(
    feature_or_geometry: Any,
    buffer_fraction: float = 0.05,
    min_buffer_degrees: float = 0.01,
) -> Dict[str, Any]:
    """Recommend a padded DEM clip envelope around a reference geometry."""
    return HmsHydrologyContext.recommend_dem_clip_extent(
        feature_or_geometry,
        buffer_fraction=buffer_fraction,
        min_buffer_degrees=min_buffer_degrees,
    )

build_taudem_handoff(gauge_metadata=None, basin_boundary=None, huc_context=None, clip_geometry=None, buffer_fraction=0.05, min_buffer_degrees=0.01) staticmethod

Build an in-memory TauDEM handoff bundle.

Source code in hms_commander/HmsTerrain.py
@staticmethod
def build_taudem_handoff(
    gauge_metadata: Optional[Mapping[str, Any]] = None,
    basin_boundary: Optional[Mapping[str, Any]] = None,
    huc_context: Optional[Mapping[str, Any]] = None,
    clip_geometry: Optional[Any] = None,
    buffer_fraction: float = 0.05,
    min_buffer_degrees: float = 0.01,
) -> Dict[str, Any]:
    """Build an in-memory TauDEM handoff bundle."""
    return HmsHydrologyContext.build_taudem_handoff(
        gauge_metadata=gauge_metadata,
        basin_boundary=basin_boundary,
        huc_context=huc_context,
        clip_geometry=clip_geometry,
        buffer_fraction=buffer_fraction,
        min_buffer_degrees=min_buffer_degrees,
    )

derive_boundary_outlet(reference_boundary_path, stream_network_path, *, output_path=None, seed_outlet_path=None, fallback_crs=None, study_name=None, workspace_root=None, site_id=None) staticmethod

Derive a downstream outlet where the main stem crosses the basin boundary.

Source code in hms_commander/HmsTerrain.py
@staticmethod
def derive_boundary_outlet(
    reference_boundary_path,
    stream_network_path,
    *,
    output_path=None,
    seed_outlet_path=None,
    fallback_crs=None,
    study_name: Optional[str] = None,
    workspace_root=None,
    site_id: Optional[str] = None,
) -> Dict[str, Any]:
    """Derive a downstream outlet where the main stem crosses the basin boundary."""
    return HmsWatershedVerification.derive_boundary_outlet(
        reference_boundary_path=reference_boundary_path,
        stream_network_path=stream_network_path,
        output_path=output_path,
        seed_outlet_path=seed_outlet_path,
        fallback_crs=fallback_crs,
        study_name=study_name,
        workspace_root=workspace_root,
        site_id=site_id,
    )

derive_taudem_boundary_outlet(stream_network_path, *, taudem_watershed_raster_path=None, taudem_boundary_path=None, output_path=None, seed_outlet_path=None, fallback_crs=None, study_name=None, workspace_root=None, site_id=None) staticmethod

Derive a handoff outlet where the TauDEM main stem crosses the TauDEM basin boundary.

Source code in hms_commander/HmsTerrain.py
@staticmethod
def derive_taudem_boundary_outlet(
    stream_network_path,
    *,
    taudem_watershed_raster_path=None,
    taudem_boundary_path=None,
    output_path=None,
    seed_outlet_path=None,
    fallback_crs=None,
    study_name: Optional[str] = None,
    workspace_root=None,
    site_id: Optional[str] = None,
) -> Dict[str, Any]:
    """Derive a handoff outlet where the TauDEM main stem crosses the TauDEM basin boundary."""
    return HmsWatershedVerification.derive_taudem_boundary_outlet(
        stream_network_path=stream_network_path,
        taudem_watershed_raster_path=taudem_watershed_raster_path,
        taudem_boundary_path=taudem_boundary_path,
        output_path=output_path,
        seed_outlet_path=seed_outlet_path,
        fallback_crs=fallback_crs,
        study_name=study_name,
        workspace_root=workspace_root,
        site_id=site_id,
    )
CLB Engineering Corporation  ·  LLM Forward Engineering
HMS Commander is a free and open-source project maintained by CLB Engineering Corporation. For agencies and firms seeking to modernize H&H workflows with LLM Forward approaches, contact CLB to partner with the engineers who wrote the automation.