diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-04-16 19:02:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-16 19:02:14 +0200 |
| commit | ff8258bcdc996522a6059a8134c994487372008a (patch) | |
| tree | 85b618ca266ca14334452b3907f42c6ee0cd6dc1 /test | |
| parent | 000fa21d070e64200bc877b9d14444262e1a14b5 (diff) | |
| parent | 0cd2912037001129ba19a50a70ff4bf28a431082 (diff) | |
| download | PROJ-ff8258bcdc996522a6059a8134c994487372008a.tar.gz PROJ-ff8258bcdc996522a6059a8134c994487372008a.zip | |
Merge pull request #2157 from rouault/map_esri_54098
Adams Square II: map ESRI WKT to PROJ string, and implement iterative inverse method
Diffstat (limited to 'test')
| -rw-r--r-- | test/gie/adams_ws2.gie | 59 | ||||
| -rw-r--r-- | test/unit/test_operation.cpp | 23 |
2 files changed, 80 insertions, 2 deletions
diff --git a/test/gie/adams_ws2.gie b/test/gie/adams_ws2.gie index b6aafee7..134148da 100644 --- a/test/gie/adams_ws2.gie +++ b/test/gie/adams_ws2.gie @@ -1,7 +1,8 @@ <gie> ------------------------------------------------------------ -This gie file was automatically generated using libproject -where the adams_ws2 code was adapted from +This gie file was initially generated from "random" test points +got by using libproject where the adams_ws2 code was adapted from +It can be edited. ------------------------------------------------------------ ------------------------------------------------------------ @@ -2117,4 +2118,58 @@ expect failure errno -14 accept 180.2003062924 109.9750225424 expect failure errno -14 +------------------------------------------------------------------------------- +Test inverse +------------------------------------------------------------------------------- +operation +proj=adams_ws2 +ellps=WGS84 +------------------------------------------------------------------------------- +direction forward +tolerance 1 mm + +accept 0 0 +expect 0 0 +roundtrip 1 + +accept 40 60 +expect 2021909.611 4162291.966 +roundtrip 1 + +accept 179.999 0 +expect 16686159.356 0.000 +roundtrip 1 + +accept -179.999 0 +expect -16686159.356 0.000 +roundtrip 1 + +accept 0 89.999 +expect 0 15743336.122 +roundtrip 1 + +accept 0 -89.999 +expect 0 -15743336.122 +roundtrip 1 + +# Results a bit different on x86 +tolerance 3 mm +accept 179.999 89.999 +expect 693320.704 16030515.906 +roundtrip 1 + +accept 179.999 -89.999 +expect 693320.702 -16030515.904 +roundtrip 1 + +accept -179.999 89.999 +expect -693320.702 16030515.904 +roundtrip 1 + +accept -179.999 -89.999 +expect -693320.704 -16030515.906 +roundtrip 1 + +direction inverse +accept 0.000005801264 16722285.492330472916 +expect failure errno non_convergent + </gie> diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 854f813c..4aa9d01e 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -4195,6 +4195,29 @@ TEST(operation, laborde_oblique_mercator) { // --------------------------------------------------------------------------- +TEST(operation, adams_ws2_export) { + auto dbContext = DatabaseContext::create(); + // ESRI:54098 WGS_1984_Adams_Square_II + auto crs = AuthorityFactory::create(dbContext, "ESRI") + ->createProjectedCRS("54098"); + EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=adams_ws2 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m " + "+no_defs +type=crs"); +} + +// --------------------------------------------------------------------------- + +TEST(operation, adams_ws2_export_failure) { + auto dbContext = DatabaseContext::create(); + // ESRI:54099 WGS_1984_Spilhaus_Ocean_Map_in_Square + auto crs = AuthorityFactory::create(dbContext, "ESRI") + ->createProjectedCRS("54099"); + EXPECT_THROW(crs->exportToPROJString(PROJStringFormatter::create().get()), + FormattingException); +} + +// --------------------------------------------------------------------------- + TEST(operation, PROJ_based) { auto conv = SingleOperation::createPROJBased(PropertyMap(), "+proj=merc", nullptr, nullptr); |
