eurostat / searoute

Compute shortest maritime routes between ports

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Points order is reversed for some coordinate pairs

siggemannen opened this issue · comments

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?