I am trying to get python to read a geoTIFF image but am having trouble trying to get the image to show.
import rasterio as r
import numpy as np
import matplotlib.pyplot as plt
FNF=r'D:\\Iceberg data\\RADARSAT\\RS2_SLC_geotif\\roi20m_RS2_20160415_153940_0004_FQ13_HHVVHVVH_SLC_470697_4660_12996414_Geo.tif\\'
raster = r.open(FNF)
print(raster)
raster.bounds
raster.height
raster.width
raster.transform
raster.get_transform()
raster.tags(1)
xmin=raster.bounds[0]
ymax=raster.bounds[3]
raster.read(1)
fig = plt.figure(1)
plt.title('SLC image') # this defines the title
plt.imshow(raster)
I get the error with imshow. What am I doing incorrectly?
When I do {i: dtype for i, dtype in zip(raster.indexes, raster.dtypes)}
I get float32 out.