This is similar to generating chainage along a line, in the sense that it is the exact opposite. Instead of creating point coordinates along a line feature using a known distance, I want to determine the distance an existing point coordinate is from the start point of a line feature, along that line feature.
This marks the first time I’m embedding a Gist in WordPress since I’m busy moving all my stuff there. The idea for this script has been percolating in my head for a few months but I could never get it quite right. Now I’m glad it has come together, based off an idea sparked by this GeoNet thread.