I am very new to GEE and coding, I've searched the web thoroughly for an answer to my question, but I don't understand the answers on the same type of questions.. So therefore I am asking (again) this question.

I am using the Copernicus Global Land Cover dataset together with a shapefile containing point coordinates of small reservoirs (obtained in QGIS). I want to add the pixel values (consisting of the fractions of landcover) of the Land Cover dataset to the shapefile (or a new table with all the information of the reservoir location). However, so far I did create the columns with the possible cover fractions together with the reservoir info, but the cover fraction columns are empty and the reservoir info columns are filled with the corresponding reservoir info.

I thought it might be the issue of using a shapefile, so I created 3 random points in GEE with the geometry function to check. But if I run those 3 points through my model, it only creates 1 row (besides the header row) where the separate values of the specific landcover fraction are all 3 together in 1 cell. So both cases are not going really well and are not the output I want..

Here's my code:

var reservoirs = ee.FeatureCollection("users/jentejanssen/New_Loc_Ghatanji");

var Ghatanji = ee.FeatureCollection("users/jentejanssen/Ghatanji_block");

var multiplepoints = /* color: #d63000 */ee.Geometry.MultiPoint(
        [[78.18223643888375, 20.06380771697672],
         [78.28334597834835, 20.073480721802248],
         [78.26137332209835, 19.99219800350948]]);

var clipToCol = function(image){
  return image.clip(Ghatanji); 

//import Copernicus land cover
var dataset = ee.ImageCollection("COPERNICUS/Landcover/100m/Proba-V/Global").map(clipToCol);

//Chose visualization bands 
var visualization = {
  bands: ['discrete_classification'],
  min: 0.0,
  max: 200.0,
  palette: [

//Zoom to area and name "Land Cover" layer, this is the layer I want to collect data from
Map.addLayer(dataset, visualization, "Land Cover");

//Display new reservoirs in Ghatanji
Map.addLayer(reservoirs, {color : 'black'}, "reservoirs");

Map.addLayer(multiplepoints, {color : 'red'}, "points");

//Reduce to reservoir regions and retreive land cover data for reservoirs
var reduced = dataset.map(function(image){
  return image.reduceRegions({
    collection: reservoirs, 
    scale: 30

//create table 
var landuse_table = reduced.flatten();

print('reservoir collection land cover', landuse_table);

//Reduce to reservoir regions and retreive land cover data for reservoirs
var reduced_points = dataset.map(function(image){
  return image.reduceRegions({
    collection: multiplepoints, 
    scale: 30

//create table 
var landuse_table_points = reduced_points.flatten();

print('random points collection land cover',landuse_table_points);

// //Export table to drive
// Export.table.toDrive({
//     collection: landuse_table,
//     description: 'landuse_table',
//     fileFormat: 'CSV',
// });

And here's the link to my GEE environment.

1 Answer 1


I'm not sure I follow completely, but maybe the below is what you're after? It adds a discrete_classification property to each reservoir.


var reservoirs = ee.FeatureCollection("users/jentejanssen/New_Loc_Ghatanji")
var landcover = ee.ImageCollection("COPERNICUS/Landcover/100m/Proba-V/Global").mosaic()
var landcoverWithClassification = landcover
    collection: reservoirs, 
    reducer: ee.Reducer.mode().setOutputs(['discrete_classification']), 
    scale: 100
  • Yes this is perfect! Thank you very much! Commented Sep 16, 2020 at 15:22

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.