I have obtained sea surface temperature data for Ascension Island and now want to export this into a csv. I managed to export the mean SST values for a previous package I was looking at (NASA/OCEANDATA/MODIS-Aqua/L3SMI) but I am now trying to use the exact same code using a different package (JAXA/GCOM-C/L3/OCEAN/SST/V3) and it won't provide me with the SST values, it just gives me these values instead:
system:index date .geo
20230101A 2023-01-01 {"type":"MultiPoint","coordinates":[]}
20230101D 2023-01-01 {"type":"MultiPoint","coordinates":[]}
20230102A 2023-01-02 {"type":"MultiPoint","coordinates":[]}.
This is the code for the package that did work:
// 5.5 - Time series and marine data
// Define the region of interest (ROI) around Ascension Island
var ROI = ee.FeatureCollection([
ee.Feature(
ee.Geometry.Rectangle([-14.57, -8.12, -14.17, -7.75]), {label: 'Ascension Island'})
]);
Map.setCenter(-14.5, -8.1, 8);
Map.addLayer(ROI, {}, 'ROI');
// Adding names to ROI
var FeatCollectAsAList = ROI.toList(ROI.size());
print(FeatCollectAsAList, 'ROI');
// Map a function over the list to rename the IDs
var ROIEdit = ee.FeatureCollection(FeatCollectAsAList.map(function(feat){
var id = ee.Feature(feat).get('id');
return ee.Feature(feat).set("system:index", id);
}));
print(ROIEdit);
// Obtain SST data from NASA MODIS
var AI_SST = ee.ImageCollection('NASA/OCEANDATA/MODIS-Aqua/L3SMI').select('sst') // use OISST for EEZ_SE
.filterDate(ee.Date('2017-01-01'), ee.Date('2018-04-01'))
.filterBounds(ROI);
// Convert ImageCollection to FeatureCollection for export
var exportFeatures = AI_SST.map(function(image) {
var date = image.date().format('YYYY-MM-dd');
var mean = image.reduceRegion({
reducer: ee.Reducer.mean(),
geometry: ROI.geometry(),
scale: 500,
maxPixels: 1e9
});
return ee.Feature(null, mean.set('date', date));
});
// Print a sample feature to check if data is being processed correctly
print('Sample feature:', exportFeatures.first());
// Export the data to Google Drive as CSV
Export.table.toDrive({
collection: exportFeatures,
description: 'SST_Ascension_Island_2017_2018',
fileFormat: 'CSV',
folder: 'EarthEngineExports' // Optional: specify a folder in Google Drive
});
This is the code for the package that did NOT work:
// 5.5 - Time series and marine data
// Define the region of interest (ROI) around Ascension Island
var ROI = ee.FeatureCollection([
ee.Feature(
ee.Geometry.Rectangle([-14.57, -8.12, -14.17, -7.75]), {label: 'Ascension Island'})
]);
Map.setCenter(-14.5, -8.1, 8);
Map.addLayer(ROI, {}, 'ROI');
// Adding names to ROI
var FeatCollectAsAList = ROI.toList(ROI.size());
print(FeatCollectAsAList, 'ROI');
// Map a function over the list to rename the IDs
var ROIEdit = ee.FeatureCollection(FeatCollectAsAList.map(function(feat){
var id = ee.Feature(feat).get('id');
return ee.Feature(feat).set("system:index", id);
}));
print(ROIEdit);
// Obtain SST data from NASA MODIS
var AI_SST = ee.ImageCollection("JAXA/GCOM-C/L3/OCEAN/SST/V3").select('SST_AVE')
.filterDate(ee.Date('2023-01-01'), ee.Date('2024-04-01'))
.filterBounds(ROI);
// Convert ImageCollection to FeatureCollection for export
var exportFeatures = AI_SST.map(function(image) {
var date = image.date().format('YYYY-MM-dd');
var mean = image.reduceRegion({
reducer: ee.Reducer.mean(),
geometry: ROI.geometry(),
scale: 500,
maxPixels: 1e9
});
return ee.Feature(null, mean.set('date', date));
});
print('Sample feature:', exportFeatures.first());
// Export the data to Google Drive as CSV
Export.table.toDrive({
collection: exportFeatures,
description: 'SST_Ascension_Island_2023_2024_2',
fileFormat: 'CSV',
folder: 'EarthEngineExports'
});
Does anyone know why the exported data is different for the different packages? I have managed to obtain the SST values I wanted by downloading the data from a chart I made, but I am just curious to know why it hasn't worked so that hopefully I know how to solve this next time I come across this problem.