Skip to content

Instantly share code, notes, and snippets.

@PratyushTripathy
Last active September 4, 2021 12:21
Show Gist options
  • Save PratyushTripathy/af413caf7c4e9907d29884a160db85d5 to your computer and use it in GitHub Desktop.
Save PratyushTripathy/af413caf7c4e9907d29884a160db85d5 to your computer and use it in GitHub Desktop.
from pyrsgis import raster
# define the file names
mx_file = r"D:\210904_ReduceGeotiffSize\l5_Bangalore2011_raw.tif"
sb_file = r"D:\210904_ReduceGeotiffSize\l5_Bangalore2011_builtup.tif"
# read both the rasters
ds_mx, arr_mx = raster.read(mx_file)
ds_sb, arr_sb = raster.read(sb_file)
# Display data type
print('Data type of multispectral file:', ds_mx.DataType)
print('Data type of single band file:', ds_sb.DataType)
# Display all the supported data types
print('Following data types are supported:\n', str(raster.raster_dtype).replace(', ',',\n '))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment