Does any one know, how to export a single feature out of featureCollection in Google Earth Engine?

I am using below code to export every features separately. The fetureCollection has 33 different features which represents different 33 geometry of regions. I want to get those geometry separately as shapefile.

The blow code gives me an error in task section: Error: Invalid argument: 'collection' must be a FeatureCollection. So, tried to get the sub_region(in the code) as ee.FeatureCollection instead of ee.Feature , but I am still getting same error.

var refReg = ee.FeatureCollection("users/username/referenceRegions");

var referenceRegions={

var region_list = refReg.toList(refReg.size());

var reg_size = refReg.size().getInfo();

for (var i = 0; i<reg_size;i++){
   var sub_region = ee.Feature(region_list.get(i));

   collection: sub_region,
   fileFormat: "SHP",

If you see the below image, the FeatureCollection refReg has all these 33 regions, I want these regions to export individually.

enter image description here

Thanks for the help!! :)

1 Answer 1


Your asset ID doesn't look correct, so I cannot try it. But just by looking at it, everything look OK except for when you pass sub_region as your Export.table.toDrive() collection. That property must be a feature collection. Try with this:

  collection: ee.FeatureCollection([sub_region]),
  description: referenceRegions[i],
  folder: "GEE_Features",
  fileFormat: "SHP",
  • Thanks Daniel, it worked :)
    – terraCoder
    Commented May 13, 2020 at 15:03

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.