Skip to content

Commit

Permalink
MIR-636 polar stereographic projection covering North Pole
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Sep 22, 2023
1 parent 66d8e5f commit c0a6dd3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/tests/projection/test_bounding_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "atlas/domain.h"
#include "atlas/domain/detail/GlobalDomain.h" // FIXME not included by atlas/domain.h
#include "atlas/grid.h"
#include "atlas/library/defines.h"
#include "atlas/runtime/Log.h"
#include "atlas/util/Point.h"
#include "atlas/util/Rotation.h"
Expand Down Expand Up @@ -240,6 +241,35 @@ CASE("MIR-282") {
Log::info().precision(old);
}

//-----------------------------------------------------------------------------


#if ATLAS_HAVE_PROJ
CASE("MIR-636") {
auto old = Log::info().precision(16);


SECTION("polar stereographic covering North/South poles") {
Grid grid =
StructuredGrid(grid::LinearSpacing(-3757840.3724026307, 3412159.6275973693, 2),
grid::LinearSpacing(-4230049.099532972, 2939950.900467028, 2),
Projection{"proj", util::Config("proj",
"+proj=stere +lat_ts=90.000000 +lat_0=90 +lon_0=-30.000000 "
"+k_0=1 +x_0=0 +y_0=0 +R=6371229.000000")});

auto bbox = grid->lonlatBoundingBox();
Log::info() << bbox << std::endl;

EXPECT(bbox.containsNorthPole());
EXPECT(!bbox.containsSouthPole());
}


Log::info().precision(old);
}
#endif


//-----------------------------------------------------------------------------

} // namespace test
Expand Down

0 comments on commit c0a6dd3

Please sign in to comment.