将点添加到线串

So I'm tracking a number of vessels as they travel across the ocean, creating a LINESTRING() in MySQL once I've gotten all the known GPS points from departure to arrival. Sometimes, however, I'm able to find additional points after creating the linestring, sometimes without associated time data.

So my question is: What would be the simplest way to take a linestring and add a point to it? It's reasonable to assume that, point by point, the LINESTRING doesn't change direction much and that it should be possible to deduce mathematically between which points the new point should be placed; but I can't seem to figure it out.

My solution so far finds which given coordinate on the LINESTRING is the closest, but I haven't been able to figure out the math that decides whether it should come before or after. Maybe the solution involves finding out which part of the linestring the point is closest to and then inserting it between the two coordinates that define that part of the line?

A possible answer...

Sort the GPS points by either latitude or longitude. Pick the one that has the most variation. Then construct the string that defines a line.

If the line is not "straight" or arcs in certain ways around the globe, or has to maneuver around a peninsula, or ..., the algorithm is to simplistic. Also, if the error in GPS is sometimes greater than the distance between two 'consecutive' points, the algorithm is flawed.