eurostat / searoute

Compute shortest maritime routes between ports
European Union Public License 1.2
157 stars 33 forks source link

Points order is reversed for some coordinate pairs #69

Open siggemannen opened 1 year ago

siggemannen commented 1 year ago

Hello, i'm using this library and it works great! But, there's always a but, some combinations of from / to points returns LINESTRINGs in reversed direction, which messes up my further calculation. Example:

Feature f = sr.getRoute(122.119705, 29.8336867, 116.504053, 23.445527);
System.out.println(f.getGeometry());
// prints: MULTILINESTRING ((116.504053 23.445527, 116.98349999999999 22.9925, 118.344 24.21, 118.4495 24.3335, 120 25.7, 121.3 27.8, 122.225 29.837, 122.119705 29.8336867))

But it should be 122.119705 29.83 etc first.

Any reason for this anomaly?