I'm trying to calculate GPM v6 annual precipitation using the Google Earth Engine, but show this error:

Line 11:
is not a function

enter image description here

I'm using this code:


var ano_inicial = 2000
var ano_final = 2020
var mes = ee.List.sequence(1,12)
var intervalo = ee.List.sequence(ano_inicial,ano_final)
var inicio =  ee.Date.fromYMD(ano_inicial,1,1);
var fim = ee.Date.fromYMD(ano_final,12,31);

var GPM = ee.ImageCollection('NASA/GPM_L3/IMERG_V06')
var GPM_Anual = ee.ImageCollection.fromImages(
  intervalo.map(function (ano) {
    var annual = GPM.filter(ee.Filter.calendarRange(ano,ano,'year'))
    return annual

  image : GPM_Anual,
  description : 'GPM_annual_2000_2020',
  scale : 1000,
  region : geometry,
  maxPixels : 1e9

What is wrong?

  • Don't clip, you can only clip Images not Image Collections. Either map over the collection and clip everything or just leave it out if it's not completely necessary
    – JonasV
    Commented Sep 10, 2021 at 11:15

1 Answer 1


clip is a function you can apply to images only, you are now trying to apply to the entire imageCollection. Instead you need to map over the entire collection (=select individual images) and clip it.

      return img.clip(geometry)


  • I can't run the rest of your script because the variable table is unknown to me. But defintely the approach seems to be allright if you are after the images that contain the summed value for each year.
    – Jobbo90
    Commented Sep 10, 2021 at 11:54
  • when export to google drive show error code.earthengine.google.com/f4a2be718b6bd1dc952e94d59de9cc56
    – user89083
    Commented Sep 10, 2021 at 12:54
  • You can't export an imageCollection with the export.image.toDrive() function. So you have to export each image seperately or use toBands() on the imageCollection to get that done
    – Jobbo90
    Commented Sep 10, 2021 at 13:35
  • I used .toBands() command but I can't export it yet, can you check it? code.earthengine.google.com/dd79cb3fc80ce14275d9bd8af622add7
    – user89083
    Commented Sep 11, 2021 at 4:32

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.