As per Mosaicking a Image Collection by Date (day) in Google Earth Engine, I tried the answering code from Rodrigo E. Principe.
That code is very good. I can mosaic all the images (tiles) all my area.
But my problem is that I lost all the properties in each image list after Mosaicking.
In order to analysis with Time series, I need to have metadata('system:time_start') but I can not find this Metadata in in each image list from the new ImageCollection(mosaicking).
So, Please advise how to transfer all properties to new ImageCollection after mosaicking
The Mosaic code is modified from 'Rodrigo E. Principe' by the following code:
var ROI =
ee.Geometry.Polygon(
[[[100.14445909748613, 14.689307337967634],
[100.14445909748613, 14.04009719681829],
[100.98491319904863, 14.04009719681829],
[100.98491319904863, 14.689307337967634]]], null, false);
Map.centerObject(ROI, 10);
var start = ee.Date('2017-09-03');
var finish = ee.Date('2017-10-30');
var S1 = ee.ImageCollection('COPERNICUS/S1_GRD')
.filterDate(start, finish)
.filterBounds(ROI)
.filter(ee.Filter.listContains('transmitterReceiverPolarisation', 'VH'))
.filter(ee.Filter.eq('orbitProperties_pass', 'DESCENDING'))
.filter(ee.Filter.eq('instrumentMode', 'IW'));
print('S1',S1)
/////////////////////Mosaicking a Image Collection by Date (day) ////////////////
// Difference in days between start and finish
var diff = finish.difference(start, 'day');
// Make a list of all dates
var range = ee.List.sequence(0, diff.subtract(1)).map(function(day){return start.advance(day,'day')});
// Funtion for iteraton over the range of dates
var day_mosaics = function(date, newlist) {
// Cast
date = ee.Date(date);
newlist = ee.List(newlist);
// Filter collection between date and the next day
var filtered = S1.filterDate(date, date.advance(1,'day'));
// Make the mosaic
var image_m = ee.Image(filtered.mosaic());
// Add the mosaic to a list only if the collection has images
return ee.List(ee.Algorithms.If(filtered.size(), newlist.add(image_m), newlist))
}
// Iterate over the range to make a new list, and then cast the list to an imagecollection
var S1_mosaic = ee.ImageCollection(ee.List(range.iterate(day_mosaics,ee.List([]))));
print('S1_mosaic',S1_mosaic)
// Adds a time band to the image.Original from (https://developers.google.com/earth-engine/reducers_regression)
var createTimeBand = function(image) {
return image.addBands(image.metadata('system:time_start').divide(1e18));
};
var linearFit = S1_mosaic.select(['system:time_start', 'VH'])
.reduce(ee.Reducer.linearFit());
print(linearFit)
Code link : https://code.earthengine.google.com/dbd55ea2354984025b0fc10874f23ea9