So I have a date range of MODIS temperature images that I am attempting to export from GEE for use in Google Earth. This is what the code looks like thus far:
var dataset = ee.ImageCollection('MODIS/006/MYD11A2')
.filter(ee.Filter.date('2018-05-01', '2018-06-01'));
var landSurfaceTemperature = dataset.select('LST_Day_1km');
var landSurfaceTemperatureVis = {
min: 14000.0,
max: 16000.0,
palette: [
'040274', '040281', '0502a3', '0502b8', '0502ce', '0502e6',
'0602ff', '235cb1', '307ef3', '269db1', '30c8e2', '32d3ef',
'3be285', '3ff38f', '86e26f', '3ae237', 'b5e22e', 'd6e21f',
'fff705', 'ffd611', 'ffb613', 'ff8b13', 'ff6e08', 'ff500d',
'ff0000', 'de0101', 'c21301', 'a71001', '911003'
],
};
Map.setCenter(-85.60371794450282,44.73590436363271, 8);
Map.addLayer(
landSurfaceTemperature, landSurfaceTemperatureVis,
'Land Surface Temperature');
// Create a geometry representing an export region.
var features = ee.Geometry.Rectangle([-85.1417893413635, 45.31413490213395, -86.125065708551, 44.65070625463291]);
Where I am having trouble is coding the export feature that would allow for an overlay to be placed into Google Earth. This is what I have now:
// Export the image, specifying scale and region.
Export.image.toDrive({
image: dataset.filter('LST_Day_1km'),
description: 'Overlay',
scale: 30,
region: features
});
So what do I need to add to that code to facilitate the export of the color-coded data set into a .kmz, GeoTIFF or some sort of file that could be overlayed in Google Earth? Do I need to .sum() the image set prior to export?
This is for personal use, so I do not need to embed it into a website, so I don't think I will need to use the API provided by Earth Engine....or do it?
EDIT:
After trying the below suggestion, this is what happened.
After I added the .mean() function, I could then export an image. Without that, I couldn't as I would get the error " Error: Invalid argument: 'image' must be of type Image."
I was able to successfully export a .tif that could be read in google earth when I added .mean()
Export.image.toDrive({
image: landSurfaceTemperature.mean(),
description: 'Overlay',
scale: 30,
region: features });
However, the imported image was entirely white (no data or visualization.) I'm wondering if it has to do with exporting the landSurfaceTemperatureVis variable, however when attempting to export that variable I get an error saying that it's not a valid variable to export.
Any suggestions?
EDIT 2:
Still getting a white image upon importation to Google Earth.