jorgealmerio / valuetool

QGis plugin to display in a table or plot the values from the visible raster layers at the current mouse position
4 stars 7 forks source link

Pyhton error #18

Closed gioman closed 2 years ago

gioman commented 3 years ago
ZeroDivisionError: float division by zero 
Traceback (most recent call last):
  File "/home/giovanni/.local/share/QGIS/QGIS3/profiles/default/python/plugins/valuetool/valuewidget.py", line 432, in printValue
    rowCol = self.getRowCol(layer, pos)
  File "/home/giovanni/.local/share/QGIS/QGIS3/profiles/default/python/plugins/valuetool/valuewidget.py", line 303, in getRowCol
    xres = extent.width() / layer.dataProvider().xSize()
ZeroDivisionError: float division by zero

This happens when in a project there is a layer loaded with the "QuickMapServices" plugin or any other XYZ tiles layer loaded directly with QGIS.

jfbourdon commented 3 years ago

Strange... I can't reproduce on my side but I can't see why. You can test my branch to check if the problem is still there.

gioman commented 3 years ago

Strange... I can't reproduce on my side but I can't see why. You can test my branch to check if the problem is still there.

@jfbourdon no error with this branch.

jorgealmerio commented 3 years ago

I can not reproduce too ! But I use windows 7 and Qgis 3.18. Anyway I merged the pull request and I hope it solves! Please @gioman let me know!

gioman commented 2 years ago

@jorgealmerio I confirm it fixed, thanks!

jorgealmerio commented 2 years ago

Thank you!