Distance to a ridge as function of angle (Python)
Solution will depend on the library that you use (fiona, shapely, geopanda...). My suggested algo is close to brute force, but I don't see much more efficient :
for each point, based on X and y coordinates: - compute the distance of each mountain ridge to your point
def Distance(x1,y1,x2,y2):
return ((x1-x2)^2+(y1-y2)^2)^0.5
- compute the azimuth of the line joining the ridge point and your point
def Azimuth(x1,y1,x2,y2): degBearing = math.degrees(math.atan2((x2 - x1),(y2 - y1))) if (degBearing < 0): degBearing += 360.0 return degBearing
once this is done, loop on the bearing to select the points within a given bearing, and compute the minimum distance.