I am looking for a way to clip image collection by a given polygon geometry with Python API,
The GEE JavaScript equivalent is simply ImageCollection.clip(geom)
(https://developers.google.com/earth-engine/image_visualization#clipping)
With the python API I get the error: 'ImageCollection' object has no attribute 'clip'.
I'm adding my code after using .mean()
as a reducer
My code:
set the boundary polygon
my_boundary = ee.Geometry.Polygon([ [[-5, 40],[65, 40],[65, 60],[-5, 60],[-5, 60]]] ,proj=None)
#set the ImageCollection and Image
img_Collection = ee.ImageCollection('COPERNICUS/S5P/NRTI/L3_NO2').filterDate('2020-03-01', '2020-03-27').select('NO2_column_number_density')
my_Image=img_Collection.mean().clip(my_boundary)
#Create Ipyleaflet map
my_map = ipyleaflet.Map(zoom=7)
my_map.add_layer(layer=my_Image)
my_map
error: AttributeError: 'Image' object has no attribute 'model_id'