| 65 | } |
| 66 | |
| 67 | TEST(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 | |
| 105 | TEST(CopcReaderTest, fullRead) |
| 106 | { |
nothing calls this directly
no test coverage detected