I am trying to export a CSV file from Google Earth Engine (GEE) that reflects the mean EVI value per census tract. I have script that does this exact thing for NDVI from Landsat 8 but cannot seem to get the code to work for EVI. I understand that in my NDVI script I have specific bands but being unfamiliar with Java I cannot seem to figure out how to edit it for EVI.
Script to Export mean NDVI per Census Tract:
var collection = ee.ImageCollection('LANDSAT/LC08/C01/T1')
.filterDate('2015-05-01', '2015-09-30')
var count = collection.size();
print('Number of images in collection:', count)
var composite = ee.Algorithms.Landsat.simpleComposite(collection)
var compBands = composite.bandNames()
print('Composite bands:', compBands)
var NDVIcomp = composite.normalizedDifference(['B5', 'B4']).rename('NDVI')
Map.addLayer(NDVIcomp, {min: -1, max: 1, palette: ['blue', 'white', 'green']}, 'NDVI_')
Map.addLayer(UStracts)
var bandNames = NDVIcomp.bandNames()
print('Band names:', bandNames)
//US Census Tracts
var meansCT = NDVIcomp.reduceRegions({
collection: UStracts,
reducer: ee.Reducer.mean(),
scale: 30,
});
Export.table.toDrive({
collection: meansCT,
description: 'US Tracts',
folder: 'Aim1',
fileNamePrefix: 'UStracts',
fileFormat: 'CSV'
})