0

I am trying to extract the 24 hour precipitation data of a given polygon by creating a dictionary . I have gotten results but i'm not sure if the parameters I have inserted in the reducer are correct.

The resolution that is given on GEE dataset for TRMM is 0.25 arc, so I believe it is not in WGS84, so i'm not sure if I should put 0.25 or to calculte it in km. As both give me numbers, I don't know which one is correct

var meanDictionary =totalRain.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: geometry,
  scale: 0.25,
  maxPixels: 1e9
});

Then, I have used the reducer sum() but i'm not sure if it will give me the sum of all the pixels I have on th eone image or for each pixel it will give me the sum of all the 8 umages I have used.

To better understand my cocnerns, I recommend to see my code: https://code.earthengine.google.com/39edb9298606d1912331e5d7f7d7723a

the polygon I have used is located in north of Thailand, and is random, so any polygon there would work

2

"scale" in reduceRegion() is, according to the docs:

"A nominal scale in meters of the projection to work in."

So setting this to 0.25 is not what you want to do. Instead, you can use "crs":

The projection to work in. If unspecified, the projection of the image's first band is used. If specified in addition to scale, rescaled to the specified scale.

Either don't specify the crs or scale at all, and use the default (first band's projection), or manually set it:

var projectionTRMM = dataset.first().projection()
var meanDictionary =totalRain.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: geometry,
  crs: projectionTRMM,
  maxPixels: 1e9
});

https://code.earthengine.google.com/b36cc12804b0c963f91bf4745d82daed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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