I'm writing a script to compute the intervisibility between two sets of points using the Intervisibility algorithm from the Visibility Analysis plugin which (to my knowledge) is installed by default in QGIS and available in the processing toolbox.

It needs to be standalone because I intend to pipeline and parallelize the process and don't want the interface/overhead of the application. Using the in-application python console to list the available algorithms,

for alg in QgsApplication.processingRegistry().algorithms():
    print(f"{alg.id()} --> {alg.displayName()}")

I get the following options at the end of the list.

qgis:vectorlayerscatterplot --> Vector layer scatterplot
qgis:voronoipolygons --> Voronoi polygons
visibility:Intervisibility --> Intervisibility network
visibility:Viewshed --> Viewshed
visibility:create_viewpoints --> Create viewpoints

I understand that to use these algorithms in the standalone script I need to add the algorithms provider. I do so using the following code.

import os
import sys


from qgis.core import QgsApplication

from ViewshedAnalysis.visibility_provider import VisibilityProvider
from qgis.analysis import QgsNativeAlgorithms
qgs = QgsApplication([], False)

import processing
from processing.core.Processing import Processing

However, the same code to list the algorithms now ends with,

qgis:vectorlayerscatterplot --> Vector layer scatterplot
qgis:voronoipolygons --> Voronoi polygons
: --> 
: --> 
: --> 

And, calls to visibility:Intervisibility fail with Algorithm not found error. What am I missing?


1 Answer 1


Replace the part


with the following

visibilityProvider = VisibilityProvider()

FYI, deduced from https://github.com/zoran-cuckovic/QGIS-visibility-analysis/blob/master/visibility_provider.py#L82

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.