wolfhece.services.dtm_wallonia

Class-based service to retrieve Wallonia DTM as WolfArray.

The main entry point is DtmWalloniaService, which exposes 1 m and 2 m retrieval helpers based on polygons or raw bounding coordinates.

Module Contents

wolfhece.services.dtm_wallonia._logger[source]
class wolfhece.services.dtm_wallonia._DtmWalloniaTiles[source]

Thin wrapper around the tile-index shapefile for Wallonia 1 m DTM.

On construction it downloads (or reuses from cache) the index shapefile and loads it as a Tiles instance.

idx_path: pathlib.Path[source]
_data_dir: pathlib.Path[source]
_tiles[source]
extract(bounds_vec: wolfhece.pyvertexvectors.vector, force: bool = False) wolfhece.wolf_array.WolfArray[source]

Download required tiles for bounds_vec and return a cropped WolfArray.

Parameters:
  • bounds_vec – A closed vector polygon that defines the region of interest.

  • force – If True, allow downloading more than 100 tiles without confirmation.

Returns:

WolfArray cropped to the bounding box.

Raises:
  • FileNotFoundError – If no VRT can be assembled.

  • RuntimeError – If more than 100 tiles are required and force is False.

class wolfhece.services.dtm_wallonia.DtmWalloniaService[source]

Stateful service to retrieve Wallonia DTM arrays.

This class owns its tile-manager cache so callers can control lifecycle explicitly and avoid relying on module-level global state.

_tiles: _DtmWalloniaTiles | None = None[source]
get_tiles_manager(reset: bool = False) _DtmWalloniaTiles[source]

Return a cached tile manager instance.

Parameters:

reset – If True, drop and recreate the cached manager.

Returns:

The tile-manager instance used by this service.

force_download_index() pathlib.Path[source]

Force a re-download of the tile-index shapefile and reset cache.

Returns:

Path to the downloaded index shapefile.

get_dtm_1m(bounds_vec: wolfhece.pyvertexvectors.vector, force: bool = False) wolfhece.wolf_array.WolfArray[source]

Return a 1 m WolfArray cropped to bounds_vec.

Parameters:
  • bounds_vec – Closed polygon defining the area of interest.

  • force – If True, bypass the >100-tiles safeguard.

Returns:

1 m DTM cropped to the polygon bounding box.

get_dtm_2m(bounds_vec: wolfhece.pyvertexvectors.vector, force: bool = False) wolfhece.wolf_array.WolfArray[source]

Return a 2 m WolfArray by mean-rebinning the 1 m raster.

Parameters:
  • bounds_vec – Closed polygon defining the area of interest.

  • force – If True, bypass the >100-tiles safeguard.

Returns:

2 m DTM derived from the 1 m extraction.

get_dtm_1m_xx_yy(xmin: float, xmax: float, ymin: float, ymax: float, force: bool = False) wolfhece.wolf_array.WolfArray[source]

Return a 1 m WolfArray from raw bounding coordinates.

Convenience wrapper around get_dtm_1m().

get_dtm_2m_xx_yy(xmin: float, xmax: float, ymin: float, ymax: float, force: bool = False) wolfhece.wolf_array.WolfArray[source]

Return a 2 m WolfArray from raw bounding coordinates.

Convenience wrapper around get_dtm_2m().