zoran-cuckovic/QGIS-visibility-analysis

FloatingPointError: divide by zero encountered in true_divide

Ben19Foster opened this issue · 4 comments

Hi Zoran,

I am trying to create a viewshed using the graphical modeler, the first part of creating the viewpoints works fine, however when I create the viewshed I get the following error. Also, when I do the exact same process outside of graphical modeler it works fine.
Viewshed Error

Traceback (most recent call last):

File"C:/Users/Ben/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ViewshedAnalysis\algorithms\viewshed_raster.py", line 245, in processAlgorithm interpolate = precision > 0)
File"C:/Users/Ben/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ViewshedAnalysis\algorithms\modules\visibility.py", line 178, in viewshed_raster data /= distance_matrix #all one line = (data -z - mxcurv) /mx_dist
FloatingPointError: divide by zero encountered in true_divide

Error encountered while running Viewshed

Hello,
you have quite a complex routine, many things could go wrong... There seems to be a zero viewshed radius somewhere (division by zero error). I can't tell where this could come from. (Perhaps if you attach your model I might be able to test the thing).

Hello,

I've copy and pasted the script into a PDF, let me know if it doesn't work and I will try something else.

Viewshed Script.pdf

Hello,
I can't tell what is wrong here... If you're trying to create a cumulative viewshed from a point-grid, I've attached here a model which should work : test_cumulative_viewshed.zip
As an image :
cumulative_image
Hope this would help!