please can you help me with writing script for viewshed that evaluate a count of visible cells from every pixel? Or is there any plugin that can do it?

  • 1
    Welcome to GIS SE! Would you be able to edit your question to include the GIS software, extension and version that you are using, please? Also, you will find that you are much more likely to get help with where you are stuck on code if you can post a snippet that works up to that point.
    – PolyGeo
    Oct 7, 2014 at 7:46

2 Answers 2


This is exactly what the Visibility index is. For further details see my reply to this post and my blog at this site, which describes the index and some of the complications for calculating it. The site also provides a link to the open-source software that can be used to perform the analysis. Importantly, since a cumulative viewshed area is an extremely computationally intensive thing to calculate, the algorithm uses several approaches to make it more feasible.


I would use ArcGIS for this, but the approach can be used in any GIS package which is capable of making a cumulative raster.

This is going to take a long time to run -- possibly days, depending on the size of your input raster. I suggest testing on a small subset area for, to make sure the results are what you want. But you don't need a script.

  1. Convert the raster to a point feature.

  2. Run Viewshed on the point feature, with the original raster as the elevation surface.

This produces a cumulative viewshed, instead of the traditional binary viewshed. Instead of a simple "visible/not visible" raster result, it is a count of how many of the input features are able to see a specific pixel. (Useful theoretical paper on the subject if you're interested.)

Typically, this is used with a small number of observation points -- so if 10 points are used as the input, the output raster has values from 0 to 10 depending on how many points can see a given cell. But we can assume intervisibility: if an observer can see a target point, then the target point can also see the observer point.

Therefore, if you use the entire raster as input observation points, the resulting cumulative raster tells you how many other cells each cell can see.

Your Answer

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

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