2

I would like to export only the properties of a filtered feature collection, I made a try which is probably wrong because I'm not selecting the properties I want (area, FinalDate,Id,InitialDate ) and it generates a very big csv file. So the question is how to select only the properties I need?

var dataset = ee.FeatureCollection('JRC/GWIS/GlobFire/v2/FinalPerimeters');

var mask = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017')
                              .filter(ee.Filter.eq('ECO_ID', 569));

// Filter the table geographically
var filtered = dataset.filterBounds(mask);
print('First ', filtered.first());

var visParams = {
  palette: ['f5ff64', 'b5ffb4', 'beeaff', 'ffc0e8', '8e8dff', 'adadad'],
  min: 0.0,
  max: 600000000.0,
  opacity: 0.8,
};

// Visualization
//
var image = ee.Image().float().paint(filtered, 'area');
Map.centerObject(mask, 5);

Map.addLayer(image, visParams, 'GlobFire Amazonas');
Map.addLayer(filtered, null, 'for Inspector', false);

// Export the FeatureCollection to a csv file.
Export.table.toDrive({
  collection: filtered,
  description:'GlobFireChacoSeco',
  fileFormat: 'csv'
});

1 Answer 1

3

There's an option on the Export function 'selectors' that lets you specify the ones you want (https://developers.google.com/earth-engine/apidocs/export-table-todrive):

Export.table.toDrive({
  collection: filtered,
  description:'GlobFireChacoSeco',
  fileFormat: 'csv',
  selectors: ['area', 'FinalDate','Id','InitialDate'])
});

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.