ubarsc / python-fmask

A set of command line utilities and Python modules that implement the ‘fmask’ algorithm
https://www.pythonfmask.org
GNU General Public License v3.0
75 stars 21 forks source link

Removing raster output palette/RAT #3

Closed gillins closed 8 years ago

gillins commented 8 years ago

Original report by Anonymous.


I've managed to successfully run python-fmask, producing an output .img file (please see #2 for my issues with creating output in another format). However, the final application I will be using it in does not support .img files, so I have tried to convert it to a GeoTIFF file using gdal_translate.

However, looking at the output image I find that it is a RGB image showing the FMask classes as different colours. I would like to get this output as a more 'standard' FMask output, without the colour palette or RAT...just raw digital numbers as in the original FMask.

I've tried playing around with the various options to gdal_translate, and I've had a brief look at the python-fmask code, but I can't quite see how to get this working.

Any ideas?

gillins commented 8 years ago

Original comment by Sam Gillingham (Bitbucket: gillins, GitHub: gillins).


It isn't an rgb image, but a thematic image with a raster attribute table. So the numbers are in there. Can I suggest viewing with software that properly sports RAT s like tuiview?

gillins commented 8 years ago

Original comment by Sam Gillingham (Bitbucket: gillins, GitHub: gillins).


See issue #2. Should be ok with the latest RIOS to go straight to GTiff etc.

Sounds like you may have been passing the -expand option to gdal_translate which would have confused things quite a lot.