I have an image collection in GEE consisting of 36 images, each with 23 bands of Sentinel 2 data (S2L2A).
I also have a point shapefile that I imported as an asset (RAEJORDANESIA_POINT).
I want to extract band values in these points and make a chart of it. I wrote this script:
var RAEJORDANESIA_POINT = ee.FeatureCollection('users/parivash89/Eucalyptus_Brazil/RAE_JORDANESIA_1_2_arvores_perigosas_POINTS');
Map.addLayer(RAEJORDANESIA_POINT, {color: '#e73400',strokeWidth: 10}, 'RAEJORDANESIA_POINT');
var START = ee.Date('2021-11-01');
var FINISH = ee.Date('2022-04-29');
var ImageCollection = S2L2A
.filterDate(START,FINISH)
.filterBounds(RAEJORDANESIA_POINT);
Map.addLayer(ImageCollection, {min:0,max:3000,bands:"B4,B3,B2"}, 'ImageCollection');
print(ImageCollection)
var params = {
reducer: ee.Reducer.median(),
scale: 10,
crs: 'EPSG:4326',
bands: ['B6', 'B7', 'B8', 'B8A'],
bandsRename: ['red-edge2', 'red-edge3', 'NIR', 'red-edge4']
};
// Extract zonal statistics per point per image.
var ptsStats = zonalStats(ImageCollection, RAEJORDANESIA_POINT, params);
print(ptsStats);
I found this script from https://developers.google.com/earth-engine/tutorials/community/extract-raster-values-for-points
I get the error:
Line 25: zonalStats is not defined
I also tried using reduceRegions:
var vals = ImageCollection.reduceRegions({
collection: RAEJORDANESIA_POINT,
reducer: 'mean',
scale: 10,
})
print(vals)
And I got the error:
Line 33: ImageCollection.reduceRegions is not a function
Here is the link with shared point asset enter link description here
How can I extract all band values (mostly I am interested in NIR and red-edge bands) in these point and make a chart out of it for each point?