diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2022-01-07 16:14:01 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2022-01-07 19:52:45 +0100 |
| commit | 3b4d1f324de157f2a29528a2194c6b0b52d2cd14 (patch) | |
| tree | d4a33266afbe0a287148b7da66260b02f97fea54 /test/unit | |
| parent | cf5aef989b65ed857ed03d2ed3de447daaffe5a3 (diff) | |
| download | PROJ-3b4d1f324de157f2a29528a2194c6b0b52d2cd14.tar.gz PROJ-3b4d1f324de157f2a29528a2194c6b0b52d2cd14.zip | |
Map peirce_q to pseudo WKT2 and ESRI WKT
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_io.cpp | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 5ffa461b..1c7fc812 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -6075,6 +6075,38 @@ static const struct { {"False northing", 2}, }}, + {"Peirce_Quincuncial", + {{"False_Easting", 1}, + {"False_Northing", 2}, + {"Central_Meridian", 3}, + {"Scale_Factor", 4}, + {"Latitude_Of_Origin", 5}, + {"Option", 0}}, + "Peirce Quincuncial (Square)", + { + {"Latitude of natural origin", 5}, + {"Longitude of natural origin", 3}, + {"Scale factor at natural origin", 4}, + {"False easting", 1}, + {"False northing", 2}, + }}, + + {"Peirce_Quincuncial", + {{"False_Easting", 1}, + {"False_Northing", 2}, + {"Central_Meridian", 3}, + {"Scale_Factor", 4}, + {"Latitude_Of_Origin", 5}, + {"Option", 1}}, + "Peirce Quincuncial (Diamond)", + { + {"Latitude of natural origin", 5}, + {"Longitude of natural origin", 3}, + {"Scale factor at natural origin", 4}, + {"False easting", 1}, + {"False northing", 2}, + }}, + { "Unknown_Method", {{"False_Easting", 1}, @@ -9931,6 +9963,49 @@ TEST(io, projparse_ortho_spherical_on_sphere) { // --------------------------------------------------------------------------- +TEST(io, projparse_peirce_q) { + std::string input("+proj=peirce_q +shape=square +type=crs"); + auto obj = PROJStringParser().createFromPROJString(input); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ( + crs->exportToPROJString( + PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4) + .get()), + "+proj=peirce_q +shape=square +lat_0=90 +lon_0=0 +k_0=1 +x_0=0 +y_0=0 " + "+datum=WGS84 +units=m +no_defs +type=crs"); +} + +// --------------------------------------------------------------------------- + +TEST(io, projparse_peirce_q_invalid_lat_0) { + std::string input("+proj=peirce_q +lat_0=0 +shape=square +type=crs"); + auto obj = PROJStringParser().createFromPROJString(input); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_THROW( + crs->exportToPROJString( + PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4) + .get()), + FormattingException); +} + +// --------------------------------------------------------------------------- + +TEST(io, projparse_peirce_q_invalid_k_0) { + std::string input("+proj=peirce_q +k_0=0.5 +shape=square +type=crs"); + auto obj = PROJStringParser().createFromPROJString(input); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_THROW( + crs->exportToPROJString( + PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4) + .get()), + FormattingException); +} + +// --------------------------------------------------------------------------- + TEST(io, projparse_axisswap_unitconvert_longlat_proj) { std::string input = "+type=crs +proj=pipeline +step +proj=axisswap +order=2,1 +step " |
