I'm writing a script to extract the soil moisture content of a specific polygon. The polygon covers multiple pixels, I need a weighted average of the values corresponding to those pixels. When I execute the script, the output is 'null'. I'm relatively new to Google earth engine, and haven't been able to figure out what I've done wrong.
// which dataset + where + when var image = ee.ImageCollection('NASA_USDA/HSL/SMAP_soil_moisture') .filterBounds(Zutendaal) .filterDate('2018-03-05','2019-03-06'); // select bands -> ssm = surface soil moisture (mm) var soilmoisture = image.select('ssm'); // Take average var meanDict = image.reduce(ee.Reducer.mean()); // Get the mean from the dictionary and print it. var mean = meanDict.get('ssm'); print('Gemiddelde bodemvochtgehalte (mm)', mean);
Could someone help me?
Here's the link: https://code.earthengine.google.com/c37820b890bec18142baa2b475dd7dd2