I have managed to export a time series of MODIS daily surface temperature pixel data from the Google earth Engine Code Editor using a combination of code scripts provided by Stack Exchange, here is the link https://code.earthengine.google.com/0949dc53da45580dfaf2131250187847. However the pixel-sized spaced points are not all inside the area of interest, I can`t figure out why and I feel maybe my exported data set includes data from outside the area of interest.
I have also managed to create another code script with the pixel-sized spaced points inside the area of interest, here is the link; https://code.earthengine.google.com/f73a5afed5e813f8b83a528303ab6506. But I can`t manage to combine both codes correctly to export a time series of daily surface temperature pixel data which has all the pixel-sized spaced points inside the area of interest.
Here is the feature collection/function code from the first link which does not have all the pixel-sized spaced points inside the area of interest;
function spacedPoints(fc, proj) {
var latlon = ee.Image.pixelLonLat().reproject(proj);
var coords = latlon.select(['longitude', 'latitude'])
.reduceRegion({reducer: ee.Reducer.toList(),
geometry: fc,
scale: proj.nominalScale().toInt()
});
var point_list = ee.List(coords.get('longitude')).zip(ee.List(coords.get('latitude')));
var list = ee.List([0]);
var feats = ee.FeatureCollection(point_list.map(function(point){
var ind = point_list.indexOf(point);
var feat = ee.Feature(ee.Geometry.Point(point_list.get(ind)), {'ID': ind});
return list.add(feat);
}).flatten().removeAll([0]));
return feats;
}
How can I adjust the above code so that all the pixel-sized spaced points are inside the area of interest?