lutraconsulting / serval

QGIS plugin for setting raster pixel values
41 stars 11 forks source link

Problems with QGIS 3.18 #18

Closed useher closed 4 years ago

useher commented 5 years ago

With QGIS 3.18 no raster dataset is recognized. When a raster layer is selected in the layertree, serval throws the message

'2019-08-12T11:34:21 WARNING Serval : Choose a raster to work with...'

There is no difference between a postgis-rasterdataset or a local tif-file, also no difference between rgb-tif or a otherwise numeric tif.
The Problem occurs on openSUSE LEAP 15.1 and Ubuntu 18.08. On Windows/QGIS 3.16 the plugin is working as expected.

Coshibu commented 5 years ago

Same here on Ubuntu 18.04 with ubuntu gis and qgis zansibar: 2019-10-08T11:08:56 WARNING Traceback (most recent call last): File "/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Serval/serval.py", line 290, in point_clicked self.uc.bar_warn("Choose a raster to work with...", dur=3) File "/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Serval/user_communication.py", line 48, in bar_warn self.iface.messageBar().pushMessage(self.context, msg, level=Qgis.MessageLevel.Warning, duration=dur) AttributeError: type object 'MessageLevel' has no attribute 'Warning'

artessen commented 4 years ago

I'm facing the same issue here, on Ubuntu 18.04

2019-11-20T11:06:40 WARNING Traceback (most recent call last): File "/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Serval/serval.py", line 290, in point_clicked self.uc.bar_warn("Choose a raster to work with...", dur=3) File "/home/user/.local/share/QGIS/QGIS3/profiles/default/python/plugins/Serval/user_communication.py", line 48, in bar_warn self.iface.messageBar().pushMessage(self.context, msg, level=Qgis.MessageLevel.Warning, duration=dur) AttributeError: type object 'MessageLevel' has no attribute 'Warning'

artessen commented 4 years ago

Small update: if you remove the command 'MessageLevel' from the lines 45 and 48 from the file user_communication.py, the warning and error messages are displayed correctly. Here's how both lines look like now: self.iface.messageBar().pushMessage(self.context, msg, level=Qgis.Critical) self.iface.messageBar().pushMessage(self.context, msg, level=Qgis.Warning, duration=dur)

However, the plugin is still not functional as it is not capable of identifying a raster to work with, as any operation that I try do that issue the warning "Serval: Choose a raster to work with...", even if a raster is already selected in the Layers panel.

erpas commented 4 years ago

Thanks a lot for reporting the issue. It's been fixed in master and will be published to the QGIS plugins repository shortly.