Test reprojecting UTM 15 to DD with a filter
| 59 | |
| 60 | // Test reprojecting UTM 15 to DD with a filter |
| 61 | TEST(ReprojectionFilterTest, ReprojectionFilterTest_test_1) |
| 62 | { |
| 63 | const char* epsg4326_wkt = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433],AUTHORITY[\"EPSG\",\"4326\"]]"; |
| 64 | |
| 65 | PointTable table; |
| 66 | |
| 67 | const double postX = -93.351563; |
| 68 | const double postY = 41.577148; |
| 69 | // proj 4 transformed to 16 exactly, but proj 5 will consider |
| 70 | // +ellps=GRS80 +towgs84=0,0,0 to be slighly different than +datum=WGS84 |
| 71 | // and return 15.999954 |
| 72 | const double postZ = 16.000000; |
| 73 | |
| 74 | { |
| 75 | const SpatialReference out_ref(epsg4326_wkt); |
| 76 | |
| 77 | Options ops1; |
| 78 | ops1.add("filename", Support::datapath("las/utm15.las")); |
| 79 | LasReader reader; |
| 80 | reader.setOptions(ops1); |
| 81 | |
| 82 | Options options; |
| 83 | options.add("out_srs", out_ref.getWKT()); |
| 84 | |
| 85 | ReprojectionFilter reprojectionFilter; |
| 86 | reprojectionFilter.setOptions(options); |
| 87 | reprojectionFilter.setInput(reader); |
| 88 | |
| 89 | reprojectionFilter.prepare(table); |
| 90 | PointViewSet viewSet = reprojectionFilter.execute(table); |
| 91 | EXPECT_EQ(viewSet.size(), 1u); |
| 92 | PointViewPtr view = *viewSet.begin(); |
| 93 | |
| 94 | double x, y, z; |
| 95 | getPoint(*view.get(), x, y, z); |
| 96 | |
| 97 | EXPECT_NEAR(x, postX, .000001); |
| 98 | EXPECT_NEAR(y, postY, .000001); |
| 99 | EXPECT_NEAR(z, postZ, 5e-5); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | // Test reprojecting UTM 15 to DD with a filter |
| 104 | TEST(ReprojectionFilterTest, stream_test_1) |