forked from upstream-mirrors/OpenTracks
EGM2008 offset lookup for negative longitudes was wrong.
This commit is contained in:
@@ -65,7 +65,7 @@ public class EGM2008Utils {
|
||||
if (location.getLongitude() >= 0) {
|
||||
longitude = location.getLongitude();
|
||||
} else {
|
||||
longitude = 180 + Math.abs(location.getLongitude());
|
||||
longitude = 360 + location.getLongitude();
|
||||
}
|
||||
int longitudeIndex = (int) (longitude * RESOLUTION_IN_MINUTES);
|
||||
|
||||
@@ -172,5 +172,13 @@ public class EGM2008Utils {
|
||||
public int hashCode() {
|
||||
return Objects.hash(latitudeIndex, longitudeIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Indices{" +
|
||||
"latitudeIndex=" + latitudeIndex +
|
||||
", longitudeIndex=" + longitudeIndex +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user