PyQgis GEE linkCollection function cause issues on sentinel score plus

59 Views Asked by At

I try use Pyqgis for obtain Sentinel images without clouds, using Google Score plus for Sentinel direcly on QGIS.

In Gee the code works perfecly, but when I try in Pyqgis I have issues with linkCollection function, I tested add image without linkCollection function and works fine, but When I use LinkCollection line is return AttributeError: 'ImageCollection' object has no attribute 'linkCollection'

import ee
from ee_plugin import Map


##Definição das datas da busca
START_DATE = '2023-10-01'
END_DATE = '2023-10-31'
CLEAR_THRESHOLD = 0.40
QA_BAND = 'cs_cdf'

s2SrCollection = ee.ImageCollection('COPERNICUS/S2_SR_HARMONIZED')
s2Clouds = ee.ImageCollection('COPERNICUS/S2_CLOUD_PROBABILITY')
region = ee.FeatureCollection('users/newtonmonteiro/Amazonia')
csPlus = ee.ImageCollection('GOOGLE/CLOUD_SCORE_PLUS/V1/S2_HARMONIZED')

compositeplus = s2SrCollection\
                    .filterDate(START_DATE, END_DATE)\
                    .linkCollection(csPlus, [QA_BAND])\
                    .map(lambda img: img.updateMask(img.select(QA_BAND).gte(CLEAR_THRESHOLD)))\
                    .mosaic()\
                    .clip(region)



rgbVis_SCPLUS = {'min': 400, 'max': 4500, 'bands': ['B11', 'B8', 'B3']}

Map.addLayer(compositeplus, rgbVis_SCPLUS, 'Sentinel+_'+START_DATE)

I tested it without the Socre Plus cloud filter and it works perfectly on QGIS, is return image sentinel with clouds, but when I try to use the filter, specifically linkCollection I get a error menseger - AttributeError: 'ImageCollection' object has no attribute 'linkCollection'

I like use Google Sentinel Score plus on Qgis for obtain Sentinel images without clouds

0

There are 0 best solutions below