0

I am filtering a feature collection using some adapted code from other scripts I have, is it a way to obtain only the outer geometry and not the union of all features? Simplify don't do that.

var region = ee.Geometry.Polygon(
        [[[-168.4122049619641, 71.96304726349818],
          [-168.4122049619641, 37.15429194943178],
          [-43.78329871196412, 37.15429194943178],
          [-43.78329871196412, 71.96304726349818]]], null, false);


var congo = ee.Feature(
  region
);


// Load a FeatureCollection from a table dataset: 'RESOLVE' ecoregions.
var ecoregions = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017');

//Map.addLayer(ecoregions, {}, 'default display');

// Subset protected areas to the bounds of the ecoregion feature
// and other criteria. Clip to the intersection with congo.
var protectedAreas = ecoregions
  .filter(ee.Filter.and(
    ee.Filter.bounds(region),
    ee.Filter.eq('BIOME_NUM', 6) // 4. Temperate broadleaf and mixed forests
  ))
  .map(function(feat){
    return congo.intersection(feat);
  });

Map.addLayer(protectedAreas, {}, 'NA Boreal Forest');  

1 Answer 1

1

I believe dissolve() does the trick:

protectedAreas.geometry().dissolve()

https://code.earthengine.google.com/78288afe956f3c0efb8df57f90d8059f

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.