diff --git a/src/eckit/geometry/grid/HEALPix.cc b/src/eckit/geometry/grid/HEALPix.cc index 2ae2572a9..0a4313eb5 100644 --- a/src/eckit/geometry/grid/HEALPix.cc +++ b/src/eckit/geometry/grid/HEALPix.cc @@ -103,7 +103,7 @@ const std::vector& HEALPix::latitudes() const { const std::vector& HEALPix::longitudes(size_t i) const { const auto Nj = nj(i); const auto step = 360. / static_cast(Nj); - const auto start = static_cast(i % 2) || i == 0 || i == ni() - 1 ? step / 2. : 0.; + const auto start = i < N_ || 3 * N_ - 1 < i || static_cast((i + N_) % 2) ? step / 2. : 0.; lons_.reserve(N_ * 4); lons_.resize(Nj);