1

Hopefully a simple question.

I'm concatenating some fields in a featureCollection by running this .map function:

var fc = ee.FeatureCollection('users/xxx/featurecollection')
    .map(function (feature) {      
        return feature.set('combined', 
          feature.getString('ColA')
          .cat(' ')
          .cat(feature.getString('ColB'))
          .cat(' ')
          .cat(feature.getString('ColC'))
          );      
    });
   

It works fine. But, when I go to export to an Asset, I get the error "Error: Unable to export features with empty geometry"

Export.table.toAsset({
  collection: fc,
  description:'exportToTableAssetExample',
  assetId: 'MyExportedFC',
});

Question: How do I skip features with Null/empty geometry in the above .map function?

1 Answer 1

4

The ee.Filter.bounds() drops features without a geometry. If you first construct a bounded geometry of all features, you could use this filter like this:

// bounded geometry
var bounded = fc.geometry().bounds();

// filter the feature without a geometry
var filtered = fc.filter(ee.Filter.bounds(bounded))

Example link. Alternatively, use fc.filterBounds().

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.