ronnyhdez / reclaimed_sites_ab

https://ronnyhdez.github.io/reclaimed_sites_ab/
0 stars 0 forks source link

Test new date creation to avoid error with LEAFtoolbox function #151

Closed ronnyhdez closed 1 month ago

ronnyhdez commented 1 month ago

Ref #120

ronnyhdez commented 1 month ago

The new start date and end date seem to be working:

image

ronnyhdez commented 1 month ago

With this function (tested in GEE console for the asset creation) worked:

var renameProperty = function(feature) {
  var year = ee.Number(feature.get('rclmtn_d')).int();
  var timeStart = ee.Date.fromYMD(year, 1, 1).millis();
  var timeEnd = ee.Date.fromYMD(2023, 1, 1).millis();

  feature = feature.set('system:time_start', timeStart)
                   .set('system:time_end', timeEnd);
  return feature;
};
ronnyhdez commented 1 month ago

Code is in the create_sampler_asset in the GEE project.