I have series of points extracted from a regular grid, with their X/Y coordinates. A previous algorithm (that I cannot modified!) output a list of these coordinates, but the ordering of these point is random in regard to the scope of this problem as expressed byt the following python-style notation:
[ [X_O,Y_O], [X_M, Y_M], [X_D, Y_D], ... ]
Where X Y are the X and Y coordinates of each point. I am now trying to "order" them with the following logic (from point A to point R on the grid visualisation):
[ [X_A,Y_A], [X_B, Y_B], [X_C, Y_C], ... ]
The final aim being to plot a profile with the actual value on the Z grid. I have tried a "hacky" way by just identifying the neighbours of each point and ordering the one that have not been processed yet, but it is not reliable enough as I faced many artifacts.
Is there an algorithm I missed that is designed for that problem? I have done some research but I feel I am missing out something.
Thanks!
c++
, I have three vector (X, Y and Z). The Z value is elevation and these point determine drainage basin boundaries. Point A will always be the lowest one, however there is no constrains on the others: elevation can increase or decrease along that line, which is what I'd like to visualise in a continuous way. Moreover the algorithm extracting the drainage basin is very optimised for that purpose and would be hard to modify. That's why I more looking for a geometrical approach if that makes sense? $\endgroup$ – boris Mar 1 '19 at 15:05