Hi Mario thanks for your example.
But when i try with my image tif and the shapefile , i obtened this warning
_init__.py:216: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
s = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
Traceback (most recent call last):
File "raster_in_polygon.py", line 15, in <module>
print ("Raster image intersects with polygon ID: %s" % (poly['properties']['id']))
KeyError: 'id'