Skip to content

Commit

Permalink
ECC-1708: grib_get_data returns offset longitudes in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Nov 23, 2023
1 parent a3ec82a commit 1229481
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/grib_iterator_class_regular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,14 @@ static int init(grib_iterator* iter, grib_handle* h, grib_arguments* args)
self->los[loi] = lon1;
lon1 += idir;
}
/* ECC-1406: Due to rounding, errors can accumulate.
* So we ensure the last longitude is longitudeOfLastGridPointInDegrees
*/
self->los[Ni-1] = normalise_longitude_in_degrees(lon2); // Also see ECC-1671

// ECC-1406: Due to rounding, errors can accumulate.
// So we ensure the last longitude is longitudeOfLastGridPointInDegrees
// Also see ECC-1671, ECC-1708
if (lon2 > 0) {
lon2 = normalise_longitude_in_degrees(lon2);
}
self->los[Ni-1] = lon2;

return ret;
}

0 comments on commit 1229481

Please sign in to comment.