Given a DEM (Digital Elevation Model) and a line (x1,y1) --> (x2,y2) (paired coordinates (x,y)), how can one calculate the elevation profile or cross-section projected on that line?
I am looking for an open source code that I can use in my project or pseudo-code that I can use as a guide.