ui.Chart.image seems to get tripped up by Landsat data. I've encountered the same error using Landsat 5, 7, and 8 and with several shapefiles so I'm confident it isn't a problem with the regions I'm providing. The scale I use (anywhere between 30m and 6km) doesn't make a difference either. The weird thing is this doesn't happen with MODIS data. See here and here for more on reducing MODIS data.
Both series1 and series2 plots fail with the following error:
Error generating chart: Collection.first: Error in map(ID=1):
Collection.geometry: Unable to perform this geometry operation. Please specify a non-zero error margin.
Series1 and 2 should show (for series1) individual band values over the course of the year, and (for series2) Band 1 (blue) values for individual counties over the course of the year.
Anyone have ideas on how to get past the error? Reproducible code below.
var cali = ee.FeatureCollection('ft:1S4EB6319wWW2sWQDPhDvmSBIVrD3iEmCLYB7nMM')
.filter(ee.Filter.eq('StateName', 'California'));
print("cali shape",cali);
// This function clips images to the ROI feature collection
var clipToCol = function(image){
return image.clipToCollection(cali);
};
print("clipToCol function",clipToCol);
// Load a Landsat collection, map the NDVI function over it.
var collection = ee.ImageCollection('LANDSAT/LT05/C01/T1_TOA')
.filterDate('2001-01-01', '2001-12-31')
.filterBounds(cali)
.map(clipToCol);
print("TOA Col Preview, No Clouds",collection.first());
// Define a chart with one series in the region, averaged by DOY.
// Guide here: https://developers.google.com/earth-engine/charts_image_doy_series
var series1 = ui.Chart.image.doySeries(
collection);
print("DOY series",series1);
var series2 = ui.Chart.image.doySeriesByRegion(
collection, "B1", cali, ee.Reducer.mean(), 6000,
ee.Reducer.mean(),
'label');
print("County series", series2);