I'm trying to extract values from a FeatureCollection as a list. Here's some example code that I'm using in Earth Engine's code editor:

var viirs = 

var maineCounties = 
    filter(ee.Filter.eq('StateName', 'Maine'));

var maineMeansFeatures = viirs.reduceRegions({
  collection: maineCounties,
  reducer: ee.Reducer.mean(),
  scale: 30

The "maineMeansFeatures" FeatureCollection has a column called "mean" -- I trying to extract the values in "mean" as a list (so, here, it'd be a list of 16 values -- one for each feature).

Any ideas on how to do this? (Note: I'm very new to javascript so I'm not that familiar with FeatureCollections).


Take a look at ee.FeatureCollection.aggregate_array:

Aggregates over a given property of the objects in a collection, calculating a list of all the values of the selected property.



should bring you an array of "means".

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.