1

I have 7 shapefiles, each containing a set of points.

I want to run a 'cumulative' viewshed calculation, which shows not how many points I can see in total, but how many of the 7 shapefiles can be seen simultaneously across the span of my DEM.

Essentially I want to be able to highlight which areas all 7 shapefiles are visible, and where you might only be able to see 1 or 2, regardless of the total number of points contained in the shapefiles.

I looked at this related question, but as far as I can understand it, the cumulative option in the Viewshed tool relates to the cumulative viewshed of all the points within the one shapefile - there is no option to input more than one file. However, I wondered if the answer may lie in running individual ZTVs for each shapefile, and performing some sort of raster calculation with the results?

Can anyone help me out with some advice?

I'm running Las Palmas 2.18.15 on Mac Sierra. I'm a QGIS beginner (no Python experience.)

EDIT: I could merge them, but if I understand correctly, this would result in a viewshed which highlights visibility of ANY of the points, regardless of which shapefile the points originally came from? I want to keep the points grouped, and calculate how many groups of points I can see from any single position - it doesn't matter which points or groups are visible, just if one group, two groups, three groups, four groups, etc. are visible, which is why I have created each group of points in a separate shapefile.

4
  • Could you temporarily merge the shapefiles together for the viewshed analysis?
    – jcarlson
    Commented Mar 8, 2018 at 16:26
  • 1
    I could merge them, but if I understand correctly, this would result in a viewshed which highlights visibility of ANY of the points, regardless of which shape file the points originally came from? I want to keep the points grouped, and calculate how many groups of points I can see from any single position - it doesn't matter which points or groups are visible, just if one group, two groups, three groups, four groups, etc. are visible, which is why I have created each group of points in a separate shapefile. It's difficult to explain, hopefully this clarifies my intention slightly!
    – lisagravy
    Commented Mar 8, 2018 at 16:33
  • 1
    It does. It sounds like with a binary output, you'd be able to simply sum the 7 rasters together to create a "groups visible" raster. A separate ZTV for each is probably the way to go.
    – jcarlson
    Commented Mar 8, 2018 at 16:44
  • @JoshC - thanks. Will give this a go and see how I get on.
    – lisagravy
    Commented Mar 8, 2018 at 16:48

1 Answer 1

2

However, I wondered if the answer may lie in running individual ZTVs for each shape file, and performing some sort of raster calculation with the results?

I think you are on the right track here. Run the viewshed analysis on the 7 separate shapefiles with binary output. Next, simply use r.serial from the processing toolbox. Choose all the 7 viewshed rasters as input and select the Aggregate operation = diversity. The result is a raster which gives you the number of the shapefiles that can be seen simultaneously across the DEM.

4
  • Thanks! This looks like the right idea, definitely. One thing - with the individual ZTVs, I can set <0 to transparent so that areas which have no visibility at all don't appear on my raster. However, the resulting raster from the r.series tool shows the entire DEM with a minimum value of 1? Areas which only show one shape file seem to have a value of 2, etc. The max value is still 7. Can you help me with the logic behind this? I can obviously set the 1 values to transparent, and key the 2 values as one group visible, key the 3 values as 2 groups visible, etc, but I'd just like to understand?
    – lisagravy
    Commented Mar 9, 2018 at 11:29
  • <1 I mean, not <0!
    – lisagravy
    Commented Mar 9, 2018 at 15:27
  • Hm not realy sure, another option would be to choose "sum" instead of "diversity" in r.series. This should also work, since the result from the viewshed is binary and thus the sum value should give you the number of Shapes this have visibility at this cell
    – Miron
    Commented Mar 12, 2018 at 12:58
  • Has the solution worked at the end? If yes, you could mark the question as answerd. Cheers
    – Miron
    Commented Mar 29, 2018 at 11:11

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.