0

I am trying to download a soil moisture layer for a single day from google earth engine using the following code:

var dataset = ee.ImageCollection('NASA_USDA/HSL/SMAP_soil_moisture')
                  .filter(ee.Filter.date('2010-02-01'));
var soilMoisture = dataset.select('ssm');


// Create a geometry representing an export region.
var geometry = ee.Geometry.Rectangle([-76.5060023341, 3.67837906194, -76.0152561351, 3.16455715204]);

// Export the image, specifying scale and region.
Export.image.toDrive({
  image: dataset.select('ssm').first(),
  description: 'soilMoisture',
  scale: 250,
  folder: 'google_earth',
  region: geometry,
  fileFormat: 'GeoTIFF'
})

but I got the following error: Error: Image.clipToBoundsAndScale: Parameter 'input' is required.

I have checked the records of the NASA_USDA/HSL/SMAP_soil_moisture and it goes from Jan 1, 2010 - Nov 16, 2020, therefore it should be a tiff for that day.

Any idea why it is not working?

2
  • 1
    If you run print(dataset) you'll see it's an empty imageCollection. So there is no image for that date. If you remove the date filter and print the imageCollection, you'll see that there is an image every 3 days. So the day you're filtering on doesn't exist in the collection.
    – Jon
    Commented Nov 25, 2020 at 5:03
  • 1
    Also, you're exporting at a scale of 250 m, but the SMAP data have 0.25 degree resolution, which is ~27 km. You're basically (trying to) making an image with way more pixels than you need, all of which have the same value.
    – Jon
    Commented Nov 25, 2020 at 5:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.