I have around 50 locations/points (defined by (latitude, longitude)) in a .csv file. How can I import all these points in google earth engine and then export time series of Albedo (or any other sample data) for each point in single .csv file for specified time period. My csv file should look like that first column will be Date, second column will be Albedo values for first point, third column will be Albedo values for second point, and so on.
I tried following code for two locations (I inserted points locations manually right now but It would be great if same can be done by importing these lat and lon from csv file):
var POI = ee.Geometry.MultiPoint([[-98.02325, 34.80833], [-96.66909,34.79851],
[-98.29216,34.91418]]);
var modis = ee.ImageCollection('MODIS/006/MCD43A3');
var modisAlbedo = modis.filterBounds(POI)
.filterDate('2000-01-01', '2019-12-31')
.select('Albedo_WSA_shortwave');
// Scaling
modisAlbedo = modisAlbedo.map(function(img){
var date = img.get('system:time_start');
return img.multiply(0.001).set('system_time_start', date);
});
// Create a function that takes an image, calculates the mean over a
// geometry and returns the value and the corresponding date as a
// feature.
var createAlbedo = function(img){
var date = img.get('system_time_start');
var value = img.reduceRegion(ee.Reducer.mean(), POI).get('Albedo_WSA_shortwave');
var ft = ee.Feature(null, {'system:time_start': date,
'date': ee.Date(date).format('Y/M/d'),
'value': value});
return ft;
};
// Apply the function to each image
var Albedo = modisAlbedo.map(createAlbedo);
// Export the time-series as a csv.
Export.table.toDrive({collection: Albedo,
description: 'test',
folder: 'MODIS_Albedo_006_MCD43A3',
selectors: 'date, value'});
Running the above code results only time series at single point. Please help me with following two issues:
- How can I import locations of multiple points from a csv file?
- How can I download/export Albedo (or any other sample data) time series for each of these locations in single csv file for given time period (e.g. 01/20/2002 to 12/31/2005).