0

Is it possible to export this classified image from Google Earth Engine (GEE)? I have seen similar questions but the difference is that I didn't produce that image. I tried to export it using this code:

Export.image.toDrive({
      image: img_2019,
      description: 'imageToDriveExample',
      scale: 30,
      maxPixels: 1000000000000,
      region: img_2019
    });

but I am getting a black raster. In their band description there exists 3 bands, named:

Band Description   
* lulc:  urban land use category   
* counts: the number of observations with the predicted lulc category   
* observations: the total number of observations

What I want is the first image of this link (lulc: urban land use category).

2 Answers 2

0

It seems that you are supplying the image i.e. img_2019 to the region parameter. In this, you should provide the extent polygon or the bounding coordinates of the area for which you want the data.

The documentation can be found here.

1
  • Regarding to the region parameter, the exported raster has black rectangle outside India but that can be easily removed by clipping the raster using any GIS (or other) software.
    – Nikos
    Oct 22, 2021 at 20:38
0

So the solution was pretty straight forward. Basically, I just selected the desired band (lulc) from the raster stack by using the .select('band') . The whole code is here:

var img_2019 = ee.Image("projects/resource-watch-gee/cit_049_urban_land_use_India/India_2019_v2")
 .select('lulc')
 
var CAT_BAND='lulc';

var viz_params = {    
  bands: [CAT_BAND],    
  min: 0,    
  max: 6,    
  palette: ["6ADE6A","FF5E61","FD68FF","EDED87","0b60c8","00ffff","777777"],    
  opacity: 0.8
};


Map.addLayer(img_2019, viz_params, '2019 Urban Land Use India');

Map.setCenter(79.39, 22.82, 4);

Export.image.toDrive({
      image: img_2019,
      description: 'lulc',
      scale: 30,
      maxPixels: 1000000000000,
      region: img_2019
    });

Your Answer

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

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