TiffViewer

class geoanalytics.visualization.TiffViewer.TiffViewer(inputFile)[source]

Bases: object

About this algorithm

Description:

TiffViewer is a lightweight visualization utility that reads and displays single-band raster data from TIFF files using rasterio and matplotlib. This class is ideal for visualizing satellite imagery, elevation maps, and other raster-based spatial data formats.

Parameters:
  • inputFile (str): Path to the input TIFF (.tif) file.

Attributes:
  • inputFile (str) – The path to the GeoTIFF file to be visualized.

  • imageData (numpy.ndarray) – The raster data read from the TIFF file.

Execution methods

Calling from a Python program

from geoanalytics.visualization import TiffViewer

viewer = TiffViewer("sample.tif")

viewer.run(cmap='viridis', title='Raster View')

Credits

This implementation was developed by Raashika and revised by M. Charan Teja under the supervision of Professor Rage Uday Kiran.

run(cmap='gray', title='TIFF Image')[source]

Reads and displays the first band of the given TIFF file.

Parameters:
  • cmap (str) – Matplotlib colormap for visualization (default: ‘gray’).

  • title (str) – Title to be displayed on the plot (default: ‘TIFF Image’).

Raises:

ValueError – If image data could not be loaded.