As usual, scripted using Python with all the usual suspects (GDAL, OGR) but with a new comer: Numpy.
Basically, you tell it: where to find your cross section line, DEM, and a sample interval distance. Assuming everything is projected right, it plots points. It uses those points to sample the raster for elevations (cell values). It also keeps cumulative track of distances between points. It generates a shapefile with that data. It also produces a tab delimited text file with the same data (but arguably easier to import into various graphing tools).
So we end up with something like the following (note that the profile graph was not generated by the script, just the elevation and distance data):
|Generated points on a cross section line of various trends (El Mayor rupture region). Point interval is 20 m; line vertices, start and end points, are always sampled.|
|Units are in meters, no vertical exaggeration. Was created at 1:6000 scale. Zero is sea-level.|
I don't recommend reading ARC GRID rasters into this program as it has no smart way of dealing with massive datasets. I kind of recommend using GeoTiffs for that reason... and clip to your work area or cross section.
The script is a mess... I'll release it eventually. Especially if someone asks for it.
Thanks to OpenTopography for the data that I used to test this script :)