I like this function, but I think path.Project should be percent complete. Here is why. From a geo perspective I'd have my path in Mercator or some conformal projections. I'd get the percent complete and the multiply it by the geoDistance to get the actual distance.