elevation.cache#

Attributes#

Functions#

build_vrt(root, product)

Build the <product>.vrt mosaic over the non empty cache tiles.

ensure_setup(root)

Create the product folder and its cache subfolder.

ensure_tiles(root, tiles, prepare_tile[, ...])

Fetch and cache tiles, skipping the tiles already in the cache.

is_cached(root, tile_name)

Return whether tile_name is cached, empty tiles included.

lock_tiles(datasource_root, tile_names)

lock_vrt(datasource_root, product)

resolve_cache_dir(cache_dir)

Return the DEM cache folder to use, as an absolute path.

Module Contents#

elevation.cache.build_vrt(root, product)#

Build the <product>.vrt mosaic over the non empty cache tiles.

elevation.cache.ensure_setup(root)#

Create the product folder and its cache subfolder.

The spool folder is created on demand by the cache write.

elevation.cache.ensure_tiles(root, tiles, prepare_tile, gdal_options=spatial.INT_TILE_GDAL_OPTIONS, empty_on_notfound=True, **kwargs)#

Fetch and cache tiles, skipping the tiles already in the cache.

prepare_tile returns the GDAL source of the tile, that is read in place and written to the cache as a GeoTIFF.

elevation.cache.is_cached(root, tile_name)#

Return whether tile_name is cached, empty tiles included.

elevation.cache.lock_tiles(datasource_root, tile_names)#
elevation.cache.lock_vrt(datasource_root, product)#
elevation.cache.resolve_cache_dir(cache_dir)#

Return the DEM cache folder to use, as an absolute path.

The cache_dir argument takes precedence over the EIO_CACHE_DIR environment variable, that takes precedence over the CACHE_DIR default.

elevation.cache.CACHE_DIR: str#
elevation.cache.FOLDER_LOCKFILE_NAME = '.folder_lock'#
elevation.cache.Tile#