| 58 | |
| 59 | |
| 60 | TEST(ProjPipelineFilterTest, ProjPipelineFilterTest_test_1) |
| 61 | { |
| 62 | const char* proj_pipeline = "+proj=pipeline +step +inv +proj=utm +zone=15 +step +proj=unitconvert +xy_in=rad +xy_out=deg"; |
| 63 | |
| 64 | PointTable table; |
| 65 | |
| 66 | const double postX = -93.351563; |
| 67 | const double postY = 41.577148; |
| 68 | // proj 4 transformed to 16 exactly, but proj 5 will consider |
| 69 | // +ellps=GRS80 +towgs84=0,0,0 to be slighly different than +datum=WGS84 |
| 70 | // and return 15.999954 |
| 71 | const double postZ = 16.000000; |
| 72 | |
| 73 | { |
| 74 | Options ops1; |
| 75 | ops1.add("filename", Support::datapath("las/utm15.las")); |
| 76 | LasReader reader; |
| 77 | reader.setOptions(ops1); |
| 78 | |
| 79 | Options options; |
| 80 | options.add("coord_op", proj_pipeline); |
| 81 | |
| 82 | ProjPipelineFilter projPipelineFilter; |
| 83 | projPipelineFilter.setOptions(options); |
| 84 | projPipelineFilter.setInput(reader); |
| 85 | |
| 86 | projPipelineFilter.prepare(table); |
| 87 | PointViewSet viewSet = projPipelineFilter.execute(table); |
| 88 | EXPECT_EQ(viewSet.size(), 1u); |
| 89 | PointViewPtr view = *viewSet.begin(); |
| 90 | |
| 91 | double x, y, z; |
| 92 | getPoint(*view.get(), x, y, z); |
| 93 | |
| 94 | EXPECT_NEAR(x, postX, .000001); |
| 95 | EXPECT_NEAR(y, postY, .000001); |
| 96 | EXPECT_NEAR(z, postZ, 5e-5); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | |
| 101 | TEST(ProjPipelineFilterTest, ProjPipelineFilterTest_test_inv) |