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

Method fillForwardList

io/CopcWriter.cpp:139–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void CopcWriter::fillForwardList()
140{
141 static const StringList header {
142 "dataformat_id", "major_version", "minor_version", "filesource_id",
143 "global_encoding", "project_id", "system_id", "software_id",
144 "creation_doy", "creation_year"
145 };
146 static const StringList scale { "scale_x", "scale_y", "scale_z" };
147 static const StringList offset { "offset_x", "offset_y", "offset_z" };
148
149 // Build the forward list, replacing special keywords with the proper
150 // field names.
151 for (auto& name : b->opts.forwardSpec)
152 {
153 if (name == "all")
154 {
155 b->forwards.insert(header.begin(), header.end());
156 b->forwards.insert(scale.begin(), scale.end());
157 b->forwards.insert(offset.begin(), offset.end());
158 b->forwardVlrs = true;
159 }
160 else if (name == "header")
161 b->forwards.insert(header.begin(), header.end());
162 else if (name == "scale")
163 b->forwards.insert(scale.begin(), scale.end());
164 else if (name == "offset")
165 b->forwards.insert(offset.begin(), offset.end());
166 else if (name == "format")
167 b->forwards.insert("dataformat_id");
168 else if (name == "vlr")
169 b->forwardVlrs = true;
170 else if (Utils::contains(header, name) ||
171 Utils::contains(scale, name) ||
172 Utils::contains(offset, name))
173 b->forwards.insert(name);
174 else
175 throwError("Error in 'forward' option. Unknown field for "
176 "forwarding: '" + name + "'.");
177 }
178}
179
180template <typename T>
181void CopcWriter::handleHeaderForward(const std::string& s, T& headerVal, const MetadataNode& base)

Callers

nothing calls this directly

Calls 4

containsFunction · 0.50
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected