Get header info from options and store in map for processing with metadata.
| 273 | // Get header info from options and store in map for processing with |
| 274 | // metadata. |
| 275 | void LasWriter::fillForwardList() |
| 276 | { |
| 277 | static const StringList header = { |
| 278 | "dataformat_id", "major_version", "minor_version", "filesource_id", |
| 279 | "global_encoding", "project_id", "system_id", "software_id", |
| 280 | "creation_doy", "creation_year" |
| 281 | }; |
| 282 | |
| 283 | static const StringList scale = { "scale_x", "scale_y", "scale_z" }; |
| 284 | |
| 285 | static const StringList offset = { "offset_x", "offset_y", "offset_z" }; |
| 286 | |
| 287 | // Build the forward list, replacing special keywords with the proper |
| 288 | // field names. |
| 289 | for (auto& name : d->opts.forwardSpec) |
| 290 | { |
| 291 | if (name == "all") |
| 292 | { |
| 293 | m_forwards.insert(header.begin(), header.end()); |
| 294 | m_forwards.insert(scale.begin(), scale.end()); |
| 295 | m_forwards.insert(offset.begin(), offset.end()); |
| 296 | d->forwardVlrs = true; |
| 297 | } |
| 298 | else if (name == "header") |
| 299 | m_forwards.insert(header.begin(), header.end()); |
| 300 | else if (name == "scale") |
| 301 | m_forwards.insert(scale.begin(), scale.end()); |
| 302 | else if (name == "offset") |
| 303 | m_forwards.insert(offset.begin(), offset.end()); |
| 304 | else if (name == "format") |
| 305 | m_forwards.insert("dataformat_id"); |
| 306 | else if (name == "vlr") |
| 307 | d->forwardVlrs = true; |
| 308 | else if ( |
| 309 | Utils::contains(header, name) || |
| 310 | Utils::contains(scale, name) || |
| 311 | Utils::contains(offset, name) |
| 312 | ) |
| 313 | m_forwards.insert(name); |
| 314 | else |
| 315 | throwError("Error in 'forward' option. Unknown field for " |
| 316 | "forwarding: '" + name + "'."); |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | |
| 321 | void LasWriter::readyTable(PointTableRef table) |