From 26a076a09a69fde79c8817b487c524540b5190cf Mon Sep 17 00:00:00 2001 From: Pedro Maciel Date: Fri, 3 May 2024 10:48:03 +0100 Subject: [PATCH] MIR-661 Grid projection handling covering the poles: account for "excessive" bounds --- src/mir/repres/regular/RegularGrid.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mir/repres/regular/RegularGrid.cc b/src/mir/repres/regular/RegularGrid.cc index 2cc529750..5acbd4870 100644 --- a/src/mir/repres/regular/RegularGrid.cc +++ b/src/mir/repres/regular/RegularGrid.cc @@ -74,7 +74,11 @@ RegularGrid::RegularGrid(const param::MIRParametrisation& param, const RegularGr auto bbox = projection.lonlatBoundingBox(range); ASSERT(bbox); - bbox_ = {bbox.north(), bbox.west(), bbox.south(), bbox.east()}; + // MIR-661 Grid projection handling covering the poles: account for "excessive" bounds + Longitude west(bbox.west()); + auto east = bbox.east() - bbox.west() >= Longitude::GLOBE.value() ? west + Longitude::GLOBE : bbox.east(); + + bbox_ = {bbox.north(), west, bbox.south(), east}; }