I have made some web search but coultn't find any answer regarding how to perform viewshed analysis in R without the use of external tools (e.g., GRASS). I do know that a number of interesting packages are available in R to perform viartually all types of GIS-related operations, from visualization to spatial analysis with all which lies in-between, but I seem to not have found anything regarding viewshed.

I need to have a package which does not require the use of external tools, such as GRASS or ArcGIS for instance.

  • 1
    Did you find rpygeo.Viewshed.sa at cran.r-project.org/web/packages/RPyGeo/RPyGeo.pdf ?
    – PolyGeo
    Commented Feb 21, 2018 at 7:50
  • Thanks for the suggestion. I will surely dig down into that package, which did not show up in my web searches. Still, I do not understand why my question has been downvoted.
    – NewAtGis
    Commented Feb 21, 2018 at 8:02
  • That package is the second question (under this one) that shows up in a search for "viewshed" under the R tag: gis.stackexchange.com/search?q=%5Br%5D+viewshed
    – PolyGeo
    Commented Feb 21, 2018 at 8:14
  • I have edited my original question to stress that I was referring to R packages that do not need any other external tool to run a viewshed. Also, I am going to post an answer to elaborate on a possible viable approach to address my question.
    – NewAtGis
    Commented Mar 20, 2018 at 8:53

1 Answer 1


I believe I have found a viable solution to address my (edited) original question. At the best of my web searches, I got the impression that virtually all the packages available in R to perform viewshed analysis are actually resting upon external tools, such as GRASS or ArcGIS. The same holds true for the packages pointed out to me in some of the comments I got. What I actually need is to perform viewshed from scratch in R, and I was in search of a piece of code (however provisional). I have found a nice answer here:


A sample code is also provided, which give at least some bases for possible further improvements.

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.