Get altitude over landscape

I’m trying to figure how to do this.
Any working example you guys can share?
Thanks in advance.