1

I'd like to export a Corine Land Cover (CLC) Map (i.e. an image from ee.ImageCollection("COPERNICUS/CORINE/V20/100m")) from Google Earth Engine go my Google Drive, forgoing the need to any external post-processing. Of course, land cover maps are natively provided as paletted images, i.e. every pixel contains just a single integer value indicating its class. For visualization purposes, however, one usually needs to convert these integer class values to RGB values. Inside GEE, this is either automatically done for standard datasets such as CLC, or can simply be done by defining a palette and using it as a parameter in Map.addLayer (option "palette"). But if you want to export the image and not manually assign a palette in, say, QGIS, you need to remap the integer class values to RGB triplets algorithmically. Is there a function to do this, either already pre-defined for CLC, or for arbitrary, to-be-defined palettes?

EDIT: I have already tried to use the ee.Image.visualize() function like below, but this has only given me a single constant color.

var CLC_palette = clc.get('landcover_class_palette');

var clc2 = clc.visualize({
  palette:CLC_palette,
  forceRgbOutput: true
})
2
  • 1
    Check out the visualize() function
    – Kuik
    Apr 1 '20 at 7:10
  • Have done so already, will add details to question.
    – Michael
    Apr 1 '20 at 7:30
1

Try visualize() without any arguments.

var clc = ee.ImageCollection("COPERNICUS/CORINE/V20/100m")
  .first()
  .visualize()

https://code.earthengine.google.com/8d4b720dde9ac84d4fd1ba374c3ac031

1
  • I have no idea why this works, but this is the solution. Many thanks!
    – Michael
    Apr 1 '20 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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