wolfhece.services.dtm_wallonia ============================== .. py:module:: wolfhece.services.dtm_wallonia .. autoapi-nested-parse:: Class-based service to retrieve Wallonia DTM as :class:`WolfArray`. The main entry point is :class:`DtmWalloniaService`, which exposes 1 m and 2 m retrieval helpers based on polygons or raw bounding coordinates. Module Contents --------------- .. py:data:: _logger .. py:class:: _DtmWalloniaTiles 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 :class:`~wolfhece.wolf_tiles.Tiles` instance. .. py:attribute:: idx_path :type: pathlib.Path .. py:attribute:: _data_dir :type: pathlib.Path .. py:attribute:: _tiles .. py:method:: extract(bounds_vec: wolfhece.pyvertexvectors.vector, force: bool = False) -> wolfhece.wolf_array.WolfArray Download required tiles for *bounds_vec* and return a cropped WolfArray. :param bounds_vec: A closed vector polygon that defines the region of interest. :param 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. :raises RuntimeError: If more than 100 tiles are required and force is False. .. py:class:: DtmWalloniaService 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. .. py:attribute:: _tiles :type: _DtmWalloniaTiles | None :value: None .. py:method:: get_tiles_manager(reset: bool = False) -> _DtmWalloniaTiles Return a cached tile manager instance. :param reset: If True, drop and recreate the cached manager. :returns: The tile-manager instance used by this service. .. py:method:: force_download_index() -> pathlib.Path Force a re-download of the tile-index shapefile and reset cache. :returns: Path to the downloaded index shapefile. .. py:method:: get_dtm_1m(bounds_vec: wolfhece.pyvertexvectors.vector, force: bool = False) -> wolfhece.wolf_array.WolfArray Return a 1 m WolfArray cropped to *bounds_vec*. :param bounds_vec: Closed polygon defining the area of interest. :param force: If True, bypass the >100-tiles safeguard. :returns: 1 m DTM cropped to the polygon bounding box. .. py:method:: get_dtm_2m(bounds_vec: wolfhece.pyvertexvectors.vector, force: bool = False) -> wolfhece.wolf_array.WolfArray Return a 2 m WolfArray by mean-rebinning the 1 m raster. :param bounds_vec: Closed polygon defining the area of interest. :param force: If True, bypass the >100-tiles safeguard. :returns: 2 m DTM derived from the 1 m extraction. .. py:method:: get_dtm_1m_xx_yy(xmin: float, xmax: float, ymin: float, ymax: float, force: bool = False) -> wolfhece.wolf_array.WolfArray Return a 1 m WolfArray from raw bounding coordinates. Convenience wrapper around :meth:`get_dtm_1m`. .. py:method:: get_dtm_2m_xx_yy(xmin: float, xmax: float, ymin: float, ymax: float, force: bool = False) -> wolfhece.wolf_array.WolfArray Return a 2 m WolfArray from raw bounding coordinates. Convenience wrapper around :meth:`get_dtm_2m`.