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

Function TEST

test/unit/io/CopcWriterTest.cpp:100–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100TEST(CopcWriterTest, srsWkt2)
101{
102#if GDAL_VERSION_NUM <= GDAL_COMPUTE_VERSION(3,6,0)
103 // not working with PROJ >= 9.2.0 https://github.com/OSGeo/gdal/pull/6800
104 std::cerr << "Test disabled with GDAL <= 3.6.0" << std::endl;
105 return;
106#endif
107 const auto filename = Support::temppath("srsWkt2.copc.las");
108 {
109 Options readerOps;
110 readerOps.add("filename", Support::datapath("las/utm15.las"));
111
112 LasReader reader;
113 reader.setOptions(readerOps);
114
115 Options writerOps;
116 writerOps.add("filename", filename);
117 writerOps.add("a_srs", wkt2DerivedProjected);
118 writerOps.add("enhanced_srs_vlrs", true);
119 CopcWriter writer;
120 writer.setInput(reader);
121 writer.setOptions(writerOps);
122
123 PointTable table;
124 writer.prepare(table);
125 writer.execute(table);
126 }
127
128 {
129 Options options;
130 options.add("filename", filename);
131
132 CopcReader creader;
133 creader.setOptions(options);
134
135 const QuickInfo qi(creader.preview());
136 std::string srs = qi.m_srs.getWKT();
137
138 EXPECT_TRUE(Utils::startsWith(srs, "DERIVEDPROJCRS[\"Custom Site Calibrated CRS\""));
139 }
140
141 {
142 Options options;
143 options.add("filename", filename);
144 options.add("srs_vlr_order", "projjson, wkt2");
145
146 CopcReader creader;
147 creader.setOptions(options);
148
149 const QuickInfo qi(creader.preview());
150 std::string srs = qi.m_srs.getPROJJSON();
151
152 EXPECT_TRUE(Utils::startsWith(srs, "{\n \"type\": \"DerivedProjectedCRS\","));
153 }
154}
155
156TEST(CopcWriterTest, srsUTM)
157{

Callers

nothing calls this directly

Calls 15

temppathFunction · 0.85
datapathFunction · 0.85
startsWithFunction · 0.85
deleteFileFunction · 0.85
setOptionsMethod · 0.80
getWKTMethod · 0.80
getPROJJSONMethod · 0.80
registerDimsMethod · 0.80
createFileFunction · 0.50
addMethod · 0.45
prepareMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected