extract_values_to_points not showing FeatureCollection id #2067
-
Hi, When I run This is the code: # open FeatureCollection
path_CAM=r"~/CAM.shp"
parcelas_CAM=geemap.shp_to_ee(path_CAM)
# Open sentinel-2
geometry = parcelas_CAM.geometry()
def clipcol(image):
return image.clip(geometry)
s2=(ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
.filterDate('2019-03-18', '2022-12-19')
.filterBounds(geometry) # not redundant because reduces the images before clipping
.map(clipcol)
.select(['B8','B4', 'B3', 'B2'])
.filterMetadata('CLOUDY_PIXEL_PERCENTAGE','less_than',10) # keep it the last
)
# EVI calculation
def getEVI(image):
EVI=image.expression(
'2.5 * ((NIR - RED) / (NIR + 6 * RED - 7.5 * BLUE + 1))', {
'NIR': image.select('B8').divide(10000),
'RED': image.select('B4').divide(10000),
'BLUE': image.select('B2').divide(10000)
}).rename("EVI")
return(EVI)
s2EVI = s2.map(getEVI)
single2EVI = s2EVI.toBands()
# export values
out_dir = os.path.expanduser('~/data_exploration/')
out_csv = os.path.join(out_dir, 'evi.csv')
geemap.extract_values_to_points(parcelas_CAM, single2EVI, out_csv, scale=None) I`ve attached the csv I'm using geemap in Visual Studio Code v 1.90.2 in Ubuntu 22.04.3 LTS. Any help would be appreciated. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Can you share the shapefile for debugging? |
Beta Was this translation helpful? Give feedback.
-
The CSV contains all the attribute columns except the geometry. If you want the geometry, return the results as a FeatureCollection then export is as a shapefile. fc = geemap.extract_values_to_points(parcelas_CAM, single2EVI, scale=None)
geemap.ee_to_shp(fc, "evi.shp") |
Beta Was this translation helpful? Give feedback.
The CSV contains all the attribute columns except the geometry. If you want the geometry, return the results as a FeatureCollection then export is as a shapefile.