Google Earth Engine | Extract Monthly Rainfall in Google Earth Engine

Поделиться
HTML-код
  • Опубликовано: 26 авг 2024
  • Learn more: spatialelearni...
    Enroll in the full course: bit.ly/earth-e...
    Subscribe to our channel for more tutorials: / spatialelearning
    In this tutorial, we will discuss how to extract monthly satellite-derived rainfall on the Google Earth Engine cloud platform.
    Blog: spatialelearni...
    Courses: courses.spatia...
    RUclips: / spatialelearning
    Facebook: / spatialelearning
    Twitter: / spatialelearn
    #earthengine #remotesensing #ndvi

Комментарии • 25

  • @spatialelearning
    @spatialelearning  6 месяцев назад

    Visit our website to learn more: spatialelearning.com Hope this video was useful to you. What video topic would you like to see next?

  • @shilianjiang9678
    @shilianjiang9678 2 года назад

    Thank you!

  • @abheebandary190
    @abheebandary190 Год назад

    hello sir. firstly thank you for the code, i have a small error after using this which is occuring at the 43 line with the error as it is not a function

  • @GISYavnet
    @GISYavnet 3 года назад +2

    I can't see the whole line 40, can you show me please?

    • @batoulfadel2105
      @batoulfadel2105 3 года назад

      do you know it ? me also i cant see it

    • @cindyviviers5336
      @cindyviviers5336 2 года назад

      I think it is:
      {return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});

  • @luizamendozahumpire2008
    @luizamendozahumpire2008 3 года назад

    thanks for sharing this video =)

  • @amitkumar-qm2fv
    @amitkumar-qm2fv 2 года назад +1

    Hello Sir, I have just used your code to extract MOD16A2 data but I have got an error (Error in map(ID=256): Image.reduceRegions: Need 1 bands for Reducer.mean, image has 0) when I export data to Drive. I have used a shapefile in which there are many polygons. Can you help me, please?

  • @sufyanjan7008
    @sufyanjan7008 Год назад +1

    How to get a feature collection for the city I want?

    • @spatialelearning
      @spatialelearning  6 месяцев назад

      You need to upload your city shapefile to earth engine and clip your image by the city layer.

  • @iqbalhabibiehabibie5689
    @iqbalhabibiehabibie5689 Год назад

    I have some error by running above script like this:
    byYearMonth
    Image (1 band)
    type: Image
    bands: List (1 element)
    properties: Object (4 properties)
    FeatureCollection (Error)
    Error in map(ID=12):
    Image.reduceRegions: Need 1 bands for Reducer.mean, image has 0.
    Export Rainfall Brazil
    but if I run until byYearMonth is runs well like this:
    byYearMonth
    Image (1 band)
    type: Image
    bands: List (1 element)
    properties: Object (4 properties)
    myscript like this:
    //Lab: Extract Monthly Rainfall
    // Define countries boundary
    var countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017");
    var Brazil =countries.filter(ee.Filter.eq('country_na','Brazil'));
    //1 Monthly time series rainfall
    var rainfall = ee.ImageCollection('UCSB-CHG/CHIRPS/PENTAD')
    .select('precipitation')
    .filterDate('1981-01-01','2012-12-31')
    .map (function(img){
    var d = ee.Date(ee.Number(img.get('system:time_start')));
    var m = ee.Number(d.get ('month'));
    var y = ee.Number (d.get ('year')) ;
    return img.set({'month':m, 'year':y});
    });
    var months = ee.List.sequence(1,12);
    var years = ee.List([2012,2013,2014,2015,2016]);
    var byYearMonth= ee.ImageCollection.fromImages(
    years.map(function(y){
    return months.map(function(m){
    return rainfall.filterMetadata('year','equals', y)
    .filterMetadata('month','equals', m)
    .select ('precipitation').sum()
    .set('year',y)
    .set ('month',m)
    .set ('date',ee.Date. fromYMD (y, m, 1)) ;
    });
    }).flatten()
    );
    print("byYearMonth",byYearMonth.first());

    var proj = ee.Image(rainfall.first()).projection();
    var rainfallBrazil= byYearMonth.map(function(img) {
    var features = Brazil.map(function(f) {return f.set('date',img.get('date'),'month', img.get ('month'),'year', img.get('year'))});
    return img.reduceRegions(features,ee.Reducer.mean(), 1000, proj);
    }). flatten();
    print(rainfallBrazil.limit(10));
    //Export the FeatureCollection
    Export.table(rainfallBrazil, 'Rainfall_Brazil', {fileFormat:'CSV'});
    print ("Export Rainfall Brazil")

  • @muhammadsobanbehzad7005
    @muhammadsobanbehzad7005 2 года назад

    can anyone share this code link here?

  • @user-sr6wt3ir4q
    @user-sr6wt3ir4q 10 месяцев назад

    Is it possible to map the monthly images

    • @spatialelearning
      @spatialelearning  6 месяцев назад

      Yes, it is possible to map monthly images.

  • @rivanaji2304
    @rivanaji2304 3 года назад

    nice video, can i see the code in line 40 please

    • @cindyviviers5336
      @cindyviviers5336 2 года назад

      I think it is:
      {return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});

  • @mainzahillaryhamankolo1572
    @mainzahillaryhamankolo1572 2 года назад +1

    Whats the point of the video if you can not respond to people's questions?

    • @cindyviviers5336
      @cindyviviers5336 2 года назад

      I think it is:
      {return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});

  • @agustinacuna9425
    @agustinacuna9425 2 года назад +1

    I can't see the whole line 40, can you show me please?

    • @cindyviviers5336
      @cindyviviers5336 2 года назад

      I think it is:
      {return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});