ronnyhdez / reclaimed_sites_ab

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

Check validity of time start and time end properties in asset and sampler function #120

Closed ronnyhdez closed 4 months ago

ronnyhdez commented 5 months ago
          When using the following code:
sitesDictionaryL08SR = LEAF.sampleSites(
    site,
    imageCollectionName="LANDSAT/LC08/C02/T1_L2",
    algorithm=SL2PV0,
    variableName="Surface_Reflectance",
    maxCloudcover=90,
    outputScaleSize=30,
    inputScaleSize=30,
    bufferSpatialSize=0,
    bufferTemporalSize=["2021-04-01", "2022-10-01"],
    subsamplingFraction=0.99,
)

The returned message is:

Processing feature: 0  from  2021-04-01 00:00:00  to  2022-10-01 00:00:00

Which coincides with the values in the function parameters, not the properties I created for the asset as follows:

var renameProperty = function(feature) {
  var year = ee.Number(feature.get('rclmtn_d')).format('%d');
  feature = feature.set('system:time_start', year.cat('-01-01'))
                  .set('system:time_end', '2023-01-01');

  return feature;
};

// Apply the function 
var intersects = intersects.map(renameProperty);

_Originally posted by @ronnyhdez in https://github.com/ronnyhdez/reclaimed_sites_ab/issues/95#issuecomment-2188074530_

ronnyhdez commented 4 months ago

In ref #151