I'm looking for a function that would allow me to locate the closest distance point of a given altitude from a specified point on a DEM in R. For instance I have a site on the interior Tibetan plateau located at 4500 meters above sea level and I would like to know at what distance the closest 2500 meter above sea level point is located. I'm essentially asking to find the least cost path but I dont know where the point is that I would be asking to go to.
I've checked out the topodistance package, however, this presumes that I already know where the point is and only then allows me to calculate the distance. I've also checked out the leastcostpath package, however, there is an assumption that I must already know the location of the point to be travelled to. Is there a function that will allow me to do an automated search for the nearest low altitude point?
I built a relatively simple function ('NearAlt') that can perform this task. It is possible to increase its complexity by considering the slope, path cost, as well as the presence of obstacles. However, if I understood correctly, you already have another solution to take these factors into consideration.