Friday, 14 September 2018

python - Different results from GDAL raster attribute table command on mac and windows


I am trying to get the raster attribute table of the following file: Shift_cult_past_current_prediction_20160107_gr1DD.tif available here: https://www.dropbox.com/s/fmomfpro3j6dmz8/Shift_cult_past_current_prediction_20160107_gr1DD.tif?dl=0



Here is the code I am using:


import gdal
dataset = gdal.Open(dataset_uri) # dataset_uri is path to .tif file
band = dataset.GetRasterBand(1)
rat = band.GetDefaultRAT()

I am using gdal version 2.1.0 on python 2.7.11 (Mac and windows). However, while I get the raster attribute table on windows I get nothing on mac (10.9.5). What could I be doing wrong?


-- EDIT


$ conda list | grep 'gdal'
gdal 2.1.0 np111py27_1 conda-forge



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...