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

Function TEST

test/unit/io/CopcReaderTest.cpp:67–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67TEST(CopcReaderTest, inspect)
68{
69 const std::vector<std::string> dimNames = {
70 "Classification", "EdgeOfFlightLine", "GpsTime", "Intensity", "KeyPoint",
71 "NumberOfReturns", "Overlap", "PointSourceId", "ReturnNumber", "ScanAngleRank",
72 "ScanChannel", "ScanDirectionFlag", "Synthetic", "UserData", "Withheld",
73 "X", "Y", "Z"
74 };
75
76 Options options;
77 options.add("filename", copcPath);
78
79 CopcReader reader;
80 reader.setOptions(options);
81
82 const QuickInfo qi(reader.preview());
83
84 EXPECT_TRUE(qi.valid());
85 EXPECT_EQ(qi.m_bounds, pointBounds);
86 EXPECT_EQ(qi.m_pointCount, numPoints);
87 StringList d(qi.m_dimNames.begin(), qi.m_dimNames.end());
88 std::sort(d.begin(), d.end());
89 EXPECT_TRUE(std::equal(d.cbegin(), d.cend(), dimNames.cbegin()));
90
91 std::string srs = qi.m_srs.getWKT();
92 // Sometimes we get back "metre" when we're execting "meter".
93 while (true)
94 {
95 auto pos = srs.find("metre");
96 if (pos == std::string::npos)
97 break;
98 srs.replace(pos, 5, "meter");
99 }
100
101 const std::string wkt = R"(GEOCCS["unnamed",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0],UNIT["meter",1],AXIS["Geocentric X",OTHER],AXIS["Geocentric Y",OTHER],AXIS["Geocentric Z",NORTH]])";
102 EXPECT_EQ(wkt, srs);
103}
104
105TEST(CopcReaderTest, fullRead)
106{

Callers

nothing calls this directly

Calls 15

equalFunction · 0.85
readFileIntoStringFunction · 0.85
datapathFunction · 0.85
BoundsFunction · 0.85
setOptionsMethod · 0.80
getWKTMethod · 0.80
pointSizeMethod · 0.80
sortMethod · 0.80
dimNameMethod · 0.80
getPolygonsMethod · 0.80
appendPointMethod · 0.80
to2dMethod · 0.80

Tested by

no test coverage detected