MCPcopy Create free account
hub / github.com/PDAL/PDAL / TEST

Function TEST

test/unit/filters/ReprojectionFilterTest.cpp:61–101  ·  view source on GitHub ↗

Test reprojecting UTM 15 to DD with a filter

Source from the content-addressed store, hash-verified

59
60// Test reprojecting UTM 15 to DD with a filter
61TEST(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
104TEST(ReprojectionFilterTest, stream_test_1)

Callers

nothing calls this directly

Calls 10

datapathFunction · 0.85
setOptionsMethod · 0.80
getWKTMethod · 0.80
getPointFunction · 0.70
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected