0

I am attempting to generate some zonal statistics for a feature layer, approximately following the steps outlined in this tutorial.

The ImageCollection I am using comes from the Awesome GEE Catalog and apparently does not contain any system:start_time properties for any items in the collection. When I try to call the zonal statistics function from the tutorial linked above, I get an error for

Element (Error) Collection.first: Error in map(ID=Copernicus_DSM_COG_10_N00_00_E006_00_DEM): Image.date: Image 'Copernicus_DSM_COG_10_N00_00_E006_00_DEM' does not have a 'system:time_start' property.

I've tried to manually set a system:time_start property here:

//Bare Earth Elevation
var fabdem = ee.ImageCollection("projects/sat-io/open-datasets/FABDEM")
.filterBounds(fextent);
print(fabdem.first())
var test = fabdem.mosaic();
var test2 = ee.ImageCollection(test)
test2.set("system:time_start",'2023-02-13T19:33:07+00:00')
print(test2)

To simplify things, I took the original ImageCollection (which is not time sensitive) and flattened it to a mosaic, then recreated an ImageCollection as the zonalStats() function requires one. the output still does not contain a system:time_start property. Any suggestions?

1 Answer 1

0

Looks like the format was incorrect for my set() command.

//Bare Earth Elevation
var fabdem = ee.ImageCollection("projects/sat-io/open-datasets/FABDEM")
.filterBounds(fextent);
print(fabdem.first())
var test = fabdem.mosaic().set("system:time_start",ee.Date('2000-01-01').millis());
var test2 = ee.ImageCollection(test)
print(test2)

using set on the mosaic before recreating the ImageCollection did the trick.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.