Google earth engine Exporting Earth Engine Image

44 Views Asked by At

I am trying able to download .tif images from google earth engin but they are all downloaded with a dark pixel cover instead of the original color template. I want to be able to extract the images in the color scheme that is visible on the notebook.

Shell 1: Generating the Coral Map

m = geemap.Map(center=(40, -100), zoom=4)

dataset = ee.Image('ACA/reef_habitat/v2_0')

# Teti'aroa, an atoll in French Polynesia.
m.setCenter(-149.56194, -17.00872, 8)
m.setOptions('SATELLITE')
# The visualisations are baked into the image properties.

# Example mask application.
reefExtent = dataset.select('reef_mask').selfMask()
m.addLayer(reefExtent, {}, 'Global reef extent')

# Geomorphic zonation classification.
geomorphicZonation = dataset.select('geomorphic').selfMask()
m.addLayer(geomorphicZonation, {}, 'Geomorphic zonation')

# Benthic habitat classification.
benthicHabitat = dataset.select('benthic').selfMask()
m.addLayer(benthicHabitat, {}, 'Benthic habitat')

m

Shell 2: Maling a box over the region of interest

feature = m.draw_last_feature
roi = feature.geometry()

Shell 3: Downloading the image.

This is what the image downloaded looks like with a black filter:

This is what the image downloaded looks like with a black filter

# setting file path
#out_dir = os.path.join(os.path.expanduser,'CoralReefExplore-main')
out_dir = os.path.join(os.path.expanduser('~'), 'Downloads') 
filename = os.path.join(out_dir,'testing2.tif')
geemap.ee_export_image( dataset, filename=filename, scale=9, region=roi, file_per_band=False )

This is the color scheme in which I want the image:

This is the color scheme in which I want the image

0

There are 0 best solutions below