this is the code
add geometries:true in training
Get the computed geometry as a Python dictionary
roi_info = roi.getInfo()
Convert the geometry to GeoJSON format
roi_geojson = json.dumps(roi_info)
Sample the combined band using the GeoJSON formatted ROI
try:
training = combinedband.sample({
‘region’: roi_geojson,
‘scale’: scale,
‘numPixels’: numPixels,
‘tileScale’: tileScale
})
except ee.EEException as e:
print(“An error occurred during sampling:”, e)
raise e
GeoJSON Representation of ROI:
{“type”: “MultiPolygon”, “coordinates”: [[[[88.55622188714223, 21.82534658581256], [88.5574258519403, 21.823910732985585], [88.5608594018125, 21.828053216828046], [88.5608594018125, 21.828851413365474], [88.55914262461017, 21.82837429806836], [88.55776918251458, 21.827255026021245], [88.55622188714223, 21.82534658581256]]], [[[88.31852058438001, 20.86915925279151], [88.31878811930143, 20.86876680747484], [88.32042910740229, 20.868499243621688], [88.32098202135725, 20.868882787198373], [88.32098647014685, 20.869136959895762], [88.32125851276399, 20.869136977281315], [88.32126296152522, 20.86964973466753], [88.31852058438001, 20.86915925279151]]], [[[88.28486328775476, 21.602404864704695], [88.28499263245227, 21.601374873466064], [88.28512642923022, 21.601241100294356], [88.28622780669647, 21.601107325983268], [88.28623225904842, 21.601620120051447], [88.28650874921102, 21.601620132164747], [88.28596474609294, 21.602395961065326], [88.28486328775476, 21.602404864704695]]], [[[88.0412804502503