I have a imported a KML as fusion table to GEE. This fusion table is type of FeatureCollection
and contains 6 elements. I would like to create a time series of a raster (in this example MODIS LST), based on the feature. Meaning, my final goal is to get a chart (which I can export as csv), where the x-axis is the date and the y-axis is LST (or other raster value), per each feature in the feature collection, or one that contains all, which I can differentiate between them. I saw the GEE example script - Image Time Series By Region, but when I changed the feature collection there to my fusion table, I got one chart for all of my features, I assume this is the average of all of them.
What I got so far is this:
// Get temperature data for 1 year.
var modis = ee.ImageCollection('MODIS/006/MOD11A1');
var modisLST = modis.filterBounds(fc2)
.filterDate('2003-12-25', '2008-02-25')
.select('LST_Day_1km');
// Convert temperature to Celsius.
modisLST = modisLST.map(function(img){
var date = img.get('system:time_start');
return img.multiply(0.02).subtract(273.15).set('system_time_start', date);
});
// Create a function that takes an image, calculates the mean over a
// geometry and returns the value and the corresponding date as a
// feature.
var createTS = function(img){
var date = img.get('system_time_start');
var value = img.reduceRegion(ee.Reducer.mean(), fc2).get('LST_Day_1km');
var ft = ee.Feature(null, {'system:time_start': date,
'date': ee.Date(date).format('Y/M/d'),
'value': value});
return ft;
};
// Apply the function to each image in modisLST.
var TS = modisLST.map(createTS);
// Create a graph of the time-series.
var graph = ui.Chart.feature.byFeature(TS, 'system:time_start', 'value');
print(graph.setChartType("ColumnChart")
.setOptions({vAxis: {title: 'LST [deg. C]'},
hAxis: {title: 'Date'}}));
where fc2 is my fusion table that contains 6 features. How can I accomplished my goal?
ee.FeatureCollection('ft:1NYL6hUez42eXOGs9iWx0g6NWbY6orkzXyJGamDM8')
and it didn't work.. I get:Error generating chart: Image.reduceRegions, argument 'collection': Invalid type. Expected: FeatureCollection. Actual: Reducer
andImage.reduceRegions, argument 'collection': Invalid type. Expected: FeatureCollection. Actual: Reducer