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
Visit our website to learn more: spatialelearning.com Hope this video was useful to you. What video topic would you like to see next?
Thank you!
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
I can't see the whole line 40, can you show me please?
do you know it ? me also i cant see it
I think it is:
{return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});
thanks for sharing this video =)
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?
I'm also facing the dame problem
Same*
How to get a feature collection for the city I want?
You need to upload your city shapefile to earth engine and clip your image by the city layer.
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")
can anyone share this code link here?
Is it possible to map the monthly images
Yes, it is possible to map monthly images.
nice video, can i see the code in line 40 please
I think it is:
{return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});
Whats the point of the video if you can not respond to people's questions?
I think it is:
{return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});
I can't see the whole line 40, can you show me please?
I think it is:
{return f.set('date', image.get('date'),'month', image.get('month'),'year', image.get('year'))});