1

How do I remove the geometry fields from this feature collection? They are not necessary and give me a messy table in excel.

// Add reducer output to the Features in the collection.
function protected_areas (image, select_country) {var pas = image.reduceRegions({
  collection: select_country,
  reducer: ee.Reducer.frequencyHistogram(),
  scale: 30,
}); return pas.map(function(feature){
  var dict = ee.Dictionary(feature.get('histogram'))
  feature = feature.set(dict)
  return (feature)})
} // appends output from histogram into separate columns

// export function
function export_table (table, description, date) { 
  var em = Export.table.toDrive({
    collection: ee.FeatureCollection(table),
    description: region+'_'+description+'_'+date,
    folder: region
});return em}

link to code: https://code.earthengine.google.com/dba0dca5d0395d981ae3e1e97126e49a

2

You can remove the geometries by setting them to "null", like this (https://code.earthengine.google.com/e8812348780874f1ac9d54a080fc4071):

// Add reducer output to the Features in the collection.
function protected_areas (image, select_country) {var pas = image.reduceRegions({
  collection: select_country,
  reducer: ee.Reducer.frequencyHistogram(),
  scale: 30,
}); return pas.map(function(feature){
  var dict = ee.Dictionary(feature.get('histogram'))
  feature = feature.set(dict).setGeometry(null)
  return (feature)})
} // appends output from histogram into separate columns

// export function
function export_table (table, description, date) { 
  var em = Export.table.toDrive({
    collection: ee.FeatureCollection(table),
    description: region+'_'+description+'_'+date,
    folder: region
});return em}

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.