[GIS] QGIS 3.10 problem with viewshed plugin

demqgisvisibility

Continuing the strenuous trial of generating the viewshed for the points, from
QGIS viewshed plugin returns error I am still getting an error:

Traceback (most recent call last): File
"C:/Users/mariuszk/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ViewshedAnalysis\algorithms\viewshed_raster.py",
line 233, in processAlgorithm refraction = refraction ) File
"C:/Users/mariuszk/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\ViewshedAnalysis\algorithms\modules\Raster.py",
line 147, in set_master_window self.window = np.zeros((full_size,
full_size)) MemoryError: Unable to allocate array with shape (9600001,
9600001) and data type float64 Execution failed after 1.26 seconds

I do not know where the problem is and how to encounter some steps, which I couldn't find.

Basically I have:

  1. Points prepared – imported in the CSV comma delimited layer, which has been added as a vector layer, and saved as a point SHP layer with the random geometry.
  2. I have also the DEM incorporated as a raster layer.

So, now I am following the steps in the Viewshed plugin, selecting the observer location and the DIgital Elevation model (in my case the .tif file).
Then atmospheric refraction remains default and earth curvatore is selected.
With or without output file, the result is the same.

enter image description here

Moreover this error appear also when I select another Visibility options like "Depth below the horizon" or "Create viewpoints", etc. This error is EXACTLY the same:

self.window = np.zeros((full_size, full_size))

MemoryError: Unable to allocate array with shape (9600001, 9600001) and data type float64

I did a deep searching throughout the web and I found as follows:
This plugin works on the different way in QGIS 3x
Error memory on Viewshed Analysis plugin QGIS
https://github.com/zoran-cuckovic/QGIS-visibility-analysis/issues/17

where the way of using it is different, the best explained here:

https://landscapearchaeology.org/2018/visibility-analysis-0-6/

It looks like is a lack of information between the DEM stage and using this plugin.

The video below:
https://www.youtube.com/watch?v=fGKgvg0QoXA&t=124s

could explain it the best, but again – they have all stuff ready prepared – points & dem), whilst DEM looks like 3D instead of raster.

The tutorial for GIS 3x mentions the "Processing ยป Graphical Modeller", but to be honest apart from the screenshot (coming from QGIS 2.8) I don't know how to set these scripts.

Could anyone advise how to make this plugin usable?

Best Answer

This error comes from the inappropriate layer input. First of all we must save our imported .csv layer in the .shp format. In the geometry type it would be good to include the z-dimension and select the point layer. enter image description here

Then we can run the plugin and everything is fine

enter image description here

Related Question