gee-community / qgis-earthengine-plugin

Integrates Google Earth Engine and QGIS using Python API
http://qgis-ee-plugin.appspot.com
MIT License
454 stars 116 forks source link

Current pre-release 0.0.3 fails in QGIS 3.14 #78

Closed gena closed 3 years ago

gena commented 3 years ago

Master version of the plugin (pre-release) fails in QGIS 3.14.16:

Traceback (most recent call last):
  File "C:/Users/gena/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\provider.py", line 56, in createProvider
    return EarthEngineRasterDataProvider(uri, providerOptions, flags)
  File "C:/Users/gena/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\provider.py", line 36, in __init__
    super().__init__(*args, **kwargs)
TypeError: QgsRasterDataProvider(): arguments did not match any overloaded call:
  overload 1: too many arguments
  overload 2: too many arguments
Traceback (most recent call last):
  File "C:\OSGEO4~1\apps\Python37\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "C:/Users/gena/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\Map.py", line 29, in addLayer
    ee_plugin.utils.add_or_update_ee_layer(eeObject, visParams, name, shown, opacity)
  File "C:/Users/gena/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\utils.py", line 145, in add_or_update_ee_layer
    update_ee_layer_properties(layer, eeObject, visParams, shown, opacity)
  File "C:/Users/gena/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ee_plugin\utils.py", line 41, in update_ee_layer_properties
    layer.dataProvider().set_ee_object(eeObject)
AttributeError: 'NoneType' object has no attribute 'set_ee_object'
gena commented 3 years ago

This commit broke it: https://github.com/gee-community/qgis-earthengine-plugin/commit/9c58298709f2aad478f8de154c802872d62c0a7b

XavierCLL commented 3 years ago

I don't think that this 9c58298 is related, it's saying that eeObject = None, what example are you trying to run?

XavierCLL commented 3 years ago

be sure that "ee.Image(1)" that you're traying to add in addLayer() is a valid eeObject

XavierCLL commented 3 years ago

I tested the latest version with Qgis 3.14 on Windows without errors (but let me test it again...)

gena commented 3 years ago

It fails when creating provider, the flags should not be passed even when it's None

gena commented 3 years ago

It seems I've used the wrong files in 0.0.3 in experimental once it was created the first time, maybe that's why it worked, or did you test it with the local source code?

I've just re-uploaded 0.0.3 on the QGIS plugins website, it includes this fix as well, just tested locally, works fine with 3.14.16, hopefully, it works in 3.16 as well.

XavierCLL commented 3 years ago

yeah, I tested with the latest version and happened that error, I implemented the fixes in 79 and works fine!

XavierCLL commented 3 years ago

works in Qgis 3.16 as well