geodata.mask.open_tif

geodata.mask.open_tif#

geodata.mask.open_tif(layer_path: str, show_raster: bool = True, close: bool = False) rasterio.DatasetReader#

Open a layer using rasterio given a file path.

Parameters:
  • layer_path (str) – The path to the TIFF file.

  • show_raster (bool) – Whether the method will plot the raster. True by default.

  • close (bool) – Whether the method will close the raster afterward, prevent possible permission errors. False by default.

Returns:

The opened raster.

Return type:

rasterio.DatasetReader

Raises:

FileNotFoundError – If the layer_path does not exist.