I have a raster surface model and I'm trying to determine the height an object would need to be at to be visible from an arbitrary point at an arbitrary altitude.

I am currently using Grass and have tried r.viewshed, while it does seem to be able to generate an elevation delta between the raster and the observer, I do not see a way to generate a delta between the raster and the line of sight at every point. my expectation is that everything that is directly visible would have a value of 0, and then shadowed areas would indicate the minimum height an object would be visible at.

While I am using GRASS at the moment, I am not against considering another piece of software.

Anybody have any ideas? or am I going to have to pull the source for viewshed and modify it?

  • If not possible, you can also open an enhancement ticket at trac.osgeo.org/grass
    – markusN
    Commented Sep 18, 2015 at 14:07
  • Hello, I am looking for a solution to the same problem. Have you found an efficient solution?
    – sehan2
    Commented Apr 24, 2021 at 14:42

1 Answer 1


I guess you could achieve that with r.los. You could set different heights and see if there is a visibility.

r.los elevation.dem out=los.025 coord=598869,4916642 obs_elev=25 max_dist=1000
r.los elevation.dem out=los.050 coord=598869,4916642 obs_elev=50 max_dist=1000
r.los elevation.dem out=los.100 coord=598869,4916642 obs_elev=100 max_dist=1000

r.los will return the vertical angle in degrees and make sure that you set the max_dist to the distance you need to speed up the process.

  • This might work, although it would be extremely slow. You also need to post-process the results to compute the threshold height at the cell that would make an object visible.
    – whuber
    Commented Sep 16, 2015 at 17:37

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.