position prediction fails for close-to-the-dateline
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 218
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
It appears that the position predictor has difficulties near the dateline meridian.
You can see in the output below that it's a positive value instead of a negative one.
Testcase:
```
public void test180Meridian() {
int distanceKm = 10;
Position from = Position.create(-16.796686666666666, -179.99983333333333);
Position north = from.predict(distanceKm, 0);
Position south = from.predict(distanceKm, 180);
Position east = from.predict(distanceKm, 90);
Position west = from.predict(distanceKm, 270);
System.out.println(north);
System.out.println(south);
System.out.println(east);
System.out.println(west);
Geometries.rectangle(west.getLon(), south.getLat(), east.getLon(), north.getLat());
}
```
Output:
```
[-16.706754647233197,-179.99983333333333]
[-16.886618686100135,-179.99983333333333]
[-16.79666536204166,-179.90589349094225]
[-16.79666536204166,179.9062268242756]
```
Stacktrace:
```
java.lang.IllegalArgumentException
at com.github.davidmoten.guavamini.Preconditions.checkArgument(Preconditions.java:25)
at com.github.davidmoten.rtree.geometry.internal.RectangleDouble.(RectangleDouble.java:14)
at com.github.davidmoten.rtree.geometry.internal.RectangleDouble.create(RectangleDouble.java:23)
at com.github.davidmoten.rtree.geometry.Geometries.rectangleDouble(Geometries.java:58)
at com.github.davidmoten.rtree.geometry.Geometries.rectangle(Geometries.java:36)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.