Skip to content

Commit

Permalink
Fix broken country rule test
Browse files Browse the repository at this point in the history
  • Loading branch information
ratrun committed Aug 18, 2024
1 parent 2fb4b62 commit d164276
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web-api/src/main/java/com/graphhopper/util/PointList.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,20 @@ public double getLon(int index) {

public double getMiddleLat() {
double middleLat;
if (latitudes.length > 2) {
middleLat = latitudes[latitudes.length / 2];
if (size > 2) {
middleLat = latitudes[size / 2];
} else {
middleLat = (latitudes[0] + latitudes[latitudes.length - 1]) / 2;
middleLat = (latitudes[0] + latitudes[size - 1]) / 2;
}
return middleLat;
}

public double getMiddleLon() {
double middleLon;
if (longitudes.length > 2) {
middleLon = longitudes[longitudes.length / 2];
if (size > 2) {
middleLon = longitudes[size / 2];
} else {
middleLon = (longitudes[0] + longitudes[longitudes.length - 1]) / 2;
middleLon = (longitudes[0] + longitudes[size - 1]) / 2;
}
return middleLon;
}
Expand Down

0 comments on commit d164276

Please sign in to comment.