I want to get the precipitation totals for certain months, but when I run it on the WorldClim Climatology V1 dataset, I get the following error message. how can i fix this?

Error message:

Precipitation: Layer error: Image.select: Pattern 'prec' did not match any bands.

Here is the link: https://code.earthengine.google.com/6cb56709133460613b28eadd98992e6a

var dataset = ee.ImageCollection('WORLDCLIM/V1/MONTHLY')
                  .sum() ;
var precipitation = dataset.select('prec');
var precipitationVis = {
  min: 0.0,
  max: 200.0,
  palette: ['001137', '0aab1e', 'e7eb05', 'ff4a2d', 'e90000'],
Map.setCenter(17.93, 7.71, 2);
Map.addLayer(precipitation, precipitationVis, 'Precipitation');

image: precipitation.int(),
description: "Annualrainfall_",
region: antalya,
maxPixels: 1e13,


1 Answer 1


That ImageCollection doesn't have a timestamp so you can't filter by calendarRange. Therefore, when you filtered by calendarRange, an empty ImageCollection was returned, which caused the error. This is because there are no Images in the empty collection, hence no bands named "prec".


  • The images represent averages for the period 1960-01-01 - 1991-01-01 so your requested date range is not available.
  • There are only 12 images in the collection, one for each month, and the values are averages for that month for the entire period. Not the average for a specific month in a specific year in that period.

To access each month:

var dataset = ee.ImageCollection('WORLDCLIM/V1/MONTHLY')
    .filter(ee.Filter.inList('month', ee.List([5,6,7,8,9,10])));
var precipitation = dataset.select('prec').sum();


var dataset = ee.ImageCollection('WORLDCLIM/V1/MONTHLY')
    .filter(ee.Filter.gte('month', 5))
    .filter(ee.Filter.lte('month', 10));
var precipitation = dataset.select('prec').sum();

Or even just select the images directly:

var dataset = ee.ImageCollection([
var precipitation = dataset.select('prec').sum();

Your Answer

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

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