I performed an Unsupervised classification in GEE with 3 classes and exported the result to QGIS using:

  image: result_Unsupervised, 
  folder: 'Brazil', 
  region: ForestPlantation_Boundry,
  fileFormat: 'GeoTIFF'.

The map in GEE is shown perfectly with 3 colors,

enter image description here

however, when I open it in QGIS, I see this map:

enter image description here

The problems are that:

1: it did not get exported in the boundry of the region that I specified while exporting (which is the black square on the map)

2: the 3 classes are shown with green, blue, red colors and if I use Paletted/Unique values in the properties and classify it, the green color is not showing the classified class and is extended over all the map for no reason. So if I delete the green class, I remain with only 2 classes. SOmehow my third class is mixed with the background. Since in GEE, the map is showing perfectly as below, what am I doing wrong in QGIS?

1 Answer 1


Your masked pixels will be 0 in your exported GeoTIFF. If you want to keep your green class as 0, you can pick a different value for your masked pixels with unmask().

image: result_Unsupervised.unmask(-1)
  • Thank you @Daniel Wiell. This line solved the problem and I accept this answer. For me to understand the process better, I will appreciate it you can explain a bit about why the masked pixels get exported as 0? I am not using any mask function here.
    – Paris
    Apr 26, 2022 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.