0

I am working on a project to measure reflectance values of 225 points near 8 different glaciers. I have run across code that does this with 2 points and I have edited it to give me summertime values across the Landsat 7 time series for 225 points. When I made this edit I was not welcomed with the reflectance values. I do not know what I'm missing and I'm very lost.

I am not very new to Google Earth Engine but my Java skills are minimal. So any and all help is welcome. Here is the link to my point data if you cannot access it https://www.google.com/fusiontables/DataSource?docid=1DerChsxqvFuocqUtzTeqdBszN68LEgT2a5sZ9vuD

var pts = ee.FeatureCollection('ft:1DerChsxqvFuocqUtzTeqdBszN68LEgT2a5sZ9vuD');

//IMPORT LANDSAT IMAGE
var images_ls7 = ee.ImageCollection('LANDSAT/LE7_L1T_TOA_FMASK) //Landsat 7 TOA with F_Mask
  .filter(ee.Filter.dayOfYear(150, 240)) // Filters for Summer dates
  .filter(ee.Filter.eq('wrs_path', 68)) // Collects correct path/row
  .filter(ee.Filter.eq('wrs_row', 18));

// Empty Collection to fill
var ft = ee.FeatureCollection(ee.List([]));

var fill = function(img, ini) {
  // type cast
  var inift = ee.FeatureCollection(ini);

  // gets the values for the points in the current img
  var ft2 = img.reduceRegions(pts, ee.Reducer.first(),30);

  // gets the date of the img
  var date = img.date().format();

  // writes the date in each feature
  var ft3 = ft2.map(function(f){return f.set("date", date)});

  // merges the FeatureCollections
  return inift.merge(ft3);
};

// Iterates over the ImageCollection
var newft = ee.FeatureCollection(images_ls7.iterate(fill, ft));

// Export
Export.table.toDrive(newft,
"Description: List of points, dates, and reflectance values",
"Test Data",
"Glacier Point Band Values");
www
  • 38,575
  • 12
  • 48
  • 84
Carl
  • 1
  • 2
  • I think java tag is not right, it should be javascript, or better take it off, same to data-collection, the only tag that matters is google-earth-engine, but you can add javascript to specify you are using JS API and not Python API. – Rodrigo E. Principe May 17 '17 at 15:11
  • Is that the exact code? in line 4 you have `var images_ls7 = ee.ImageCollection('LANDSAT/LE7_L1T_TOA_FMASK) //Landsat 7 TOA with F_Mask` where it should be `var images_ls7 = ee.ImageCollection('LANDSAT/LE7_L1T_TOA_FMASK') //Landsat 7 TOA with F_Mask` – Rodrigo E. Principe May 17 '17 at 15:16

0 Answers0