get_dim_img_path#
- get_dim_img_path(dim_path: str | CloudPath | Path, img_name: str = '*') CloudPath | Path [source]#
Get the image path from a
BEAM-DIMAP
data.A
BEAM-DIMAP
file cannot be opened by rasterio, although its.img
file can.- Parameters:
dim_path (AnyPathStrType) – DIM path (.dim or .data)
img_name (str) – .img file name (or regex), in case there are multiple .img files (i.e. for S3 data)
- Returns:
.img file
- Return type:
AnyPathType
Example
>>> dim_path = "path/to/dimap.dim" # BEAM-DIMAP image >>> img_path = get_dim_img_path(dim_path) >>> >>> # Read raster >>> raster, meta = read(img_path)