1

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');

Export.table.toDrive({
  collection: polygons,
  folder: 'GEE_exports',
  fileFormat: 'KMZ'
});
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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