IndigoWizard / NDVI-Viewer

Monitor Vegetation Health by Viewing & Comparing NDVI Values & Satellite Images On The Fly!
https://ndvi-viewer.streamlit.app/
16 stars 6 forks source link

GEE: image collection #9

Closed IndigoWizard closed 1 year ago

IndigoWizard commented 1 year ago
IndigoWizard commented 1 year ago

using the collection image filtering instead of a single specific image ID and using the result for various other operations:

    #### Satellite imagery Processing Section
    # Image collection
    collection = ee.ImageCollection('COPERNICUS/S2_SR') \
    .filter(ee.Filter.lt("CLOUDY_PIXEL_PERCENTAGE", 100)) \
    .filterDate('2023-07-13', '2023-07-14') \
    .filterBounds(geometry_aoi)

    # clipping the main collection to the aoi geometry
    clipped_collection = collection.map(lambda image: image.clip(geometry_aoi).divide(10000))

    # setting a sat_imagery variable that could be used for various processes later on (tci, ndvi... etc)
    sat_imagery = clipped_collection.median() 

And from here and on we can use the sat_imagery for other things such as ndvi and tci.