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?
-
1Welcome 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
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.
Convert the raster to a point feature.
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.