I have a dataset of polygons for the entire planet that I'd like to export into a KML/KMZ file. However, I only need the data for South America. Is is possible to specify which regions to export?

This is the code I currently have:

var polygons = ee.FeatureCollection('WCMC/WDPA/current/polygons');

  collection: polygons,
  folder: 'GEE_exports',
  fileFormat: 'KMZ'

1 Answer 1


You could draw a polygon around South America, or use an additional dataset of simplified country shapefiles for South America. The latter is done below. Use filterBounds() to filter on only the polygons of the featureCollection within South America:

var polygons = ee.FeatureCollection('WCMC/WDPA/current/polygons');
var table = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017");
var southAmericaLSIB = table.filter(ee.Filter.eq('wld_rgn', 'South America'))
var southAmerica = polygons.filterBounds(southAmericaLSIB.geometry())

Map.addLayer(southAmericaLSIB, {color: 'red'})
Map.addLayer(southAmerica, {color: 'green'})

You can then export the filtered featureCollection as you did. Link code


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.