Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Write a function to export multiple CSV files for different dates in Google Earth Engine

Here by this function I can download the monthly data for a particular month. What I need is getting a CSV file which will have monthly value for all pixels(377 in my case) in a single CSV. If that's not possible a function to download monthly data CSV files for 31 years. Currently I have to modify this line var dataset = data.filter(ee.Filter.date('2001-12-01', '2001-12-30')); to get the values for all pixels for a single month and manually edit the above line for the next month and so on and make file operation manually in my PC.

Sharing the entire code

var dataset = data.filter(ee.Filter.date('2001-12-01', '2001-12-30'));
var soilMoisture = dataset.select('pr');
var soilMoistureVis = {
  //min: 0.0,
  //max: 28.0,
  min: 250,
  max: 700,
  palette: ['0300ff', '418504', 'efff07', 'efff07', 'ff0303'],
};
var rgbVis = {
  bands: ['B11', 'B8', 'B3'],
  min: 0,
  max: 3000
};

var total = soilMoisture.reduce(ee.Reducer.sum());
var totalRanchi = total.clip(ranchi);
var stats = total.reduceRegion({
  reducer: ee.Reducer.mean(),
  geometry: ranchi,
  scale: 5000,
  })
var count_px = total.reduceRegion({
  reducer: ee.Reducer.count(),
  geometry: ranchi,
  scale: 5000,
  })
print("Total Pixel = ",count_px.get('pr_sum'));
print("Amount = ",stats.get('pr_sum'))
Map.centerObject(ranchi);
//Map.addLayer(total, soilMoistureVis, 'Soil Moisture');

var vectors = totalRanchi.sample({
  region: ranchi,
  geometries: true,
  scale: 5000,// if you want points
});
print(vectors);

Map.addLayer(ranchi,rgbVis, "Ranchi")
Map.addLayer(vectors, soilMoistureVis, "Vectors");
//Map.addLayer(totalRanchi, soilMoistureVis, "Ranchi_Region");
Export.table.toDrive({
  collection: vectors,
  folder: 'earthengine_pr',
  fileNamePrefix: 'vec_',
  fileFormat: 'CSV'}) ```
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A similar question was answered here: https://gis.stackexchange.com/questions/312547/make-a-loop-for-monthly-ndvi-in-google-earth-engine

Basically you want to map your calculation and export for every month in your date range. Your code doesn't have data so I can't give you a full example, but the answer in the link above should be enough to get you started. If you run into any errors, leave a comment and I can try and help you out.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!