I am trying to apply
reduceRegions() to extract average precipitation from the TerraClimate dataset within each polygon of a feature collection. The problem is that the output of the reduction is not written to each feature property as expected. It only appears in the columns of the output feature collection. The code below is a simple implementation on the first image of the collection, using an arbitrary feature collection with 3 polygons. My end goal is to map the
reduceRegions() function to the whole TerraClimate collection. For this, I followed the steps to use
reduceRegions()outlined in this previous post: Calculate mean EVI for multiple polygons across an image collection in Google Earth Engine
The problem, and my question, is why is the result of
reduceRegions()not writing / added to the feature properties as expected? It does so in the example given in the post above (mean EVI index example). As a result, I cannot map the
reduceRegions()function to the whole collection.
Coming back to my post after some more works, it seems that this is caused by having null values returned by
reduceRegions(), so that the property is not set in this case. Now, the only way to NOT have null values is to use scale: 30 with the
reduceRegions(). The TerraClimate data is in geographic projections with a 2.5 arcminute resolution (about 4 km). Whenever I use a different scale value (1, 20, 40, 100.. 1000), I only get null values. It only works with 30 meters for scale. Anyone knows what is going on?