I want the Python source code of Grass's Viewshed analysis. In QGIS software there is only an .exe file of that algorithm. Although I'm not sure whether it's written also in python or not.

Where can I find a Python (preferably using pyqgis) source code of that analysis to get more familiar with the coding of that operation?

  • Have you seen this source code (history) grass/trunk/raster/r.viewshed? – Taras Jan 17 at 14:44
  • Yes, I've seen it but I'm looking for python source code since I don't know cpp. – Afshin Salehi Jan 17 at 14:57
  • 1
    Try to contact developers.IMHO – Taras Jan 17 at 15:04

Amongst QGIS plugins there is a Viewshed Analysis Plugin which it contains the file doViewshed.py. In that file, there is a function called Viewshed which is the conventional algorithm to do viewshed analysis based on comparing distance and angle of surrounding points regarding the observer point.

If you want to get familiar with all the existing algorithms to do viewshed analysis please refer to this source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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