Estoy tratando de trazar los datos del SIG, un archivo tiff usando gdal y luego la función imshow() pero estoy recibiendo el siguiente error -
Mi código es
import gdal
import sys
import matplotlib.pyplot as pyplot
import numpy as np
import matplotlib as ml
try:
tif = gdal.Open('lulc250k_1415_13861.tif')
tifArray = tif.ReadAsArray()
except:
print 'The file does not exist.'
sys.exit(0)
band1 = tif.GetRasterBand(1)
band1Array = band1.ReadAsArray()
pyplot.imshow(band1Array)
pyplot.show()
El gdalinfo del archivo -
Driver: GTiff/GeoTIFF
Files: lulc250k_1415_13861.tif
Size is 32716, 22789
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (72.486328125000000,32.233886718750000)
Pixel Size = (0.000509086484824,-0.000509086072228)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 72.4863281, 32.2338867) ( 72d29'10.78"E, 32d14' 1.99"N)
Lower Left ( 72.4863281, 20.6323242) ( 72d29'10.78"E, 20d37'56.37"N)
Upper Right ( 89.1416016, 32.2338867) ( 89d 8'29.77"E, 32d14' 1.99"N)
Lower Right ( 89.1416016, 20.6323242) ( 89d 8'29.77"E, 20d37'56.37"N)
Center ( 80.8139648, 26.4331055) ( 80d48'50.27"E, 26d25'59.18"N)
Band 1 Block=32716x1 Type=Byte, ColorInterp=Palette
NoData Value=0
Color Table (RGB with 256 entries)