You are using reduceRegion
, which does not do anything in particular about feature collections; it takes a geometry. Or, it can also accept a feature and use the feature's geometry. A feature collection is considered a kind of feature, and its geometry is the union of the geometries of its features.
So, you're asking reduceRegion
to find every pixel in the image which is intersected by your collection (which I assume is made of points). This process will:
- report a pixel only once if more than one point are inside its bounds, and
- omit all fully masked pixels.
Instead, you should use reduceRegions
, which actually takes a feature collection, and returns a feature collection, having the same features but with added properties corresponding to the reducer outputs. This will be guaranteed to have the same number of outputs as inputs. (The reducer can be almost anything, in this case, since it always gets at most one input when the feature is a point; ee.Reducer.median()
might be a good choice, for example.)
Then, if you specifically need a ee.List
instead of a feature collection, you can use .reduceColumns(ee.Reducer.toList(), ['name_of_band_goes_here'])
to get that out of the feature collection. But, working with feature collections as much as possible will give you better performance when the number of features is large.