| 81 | |
| 82 | |
| 83 | void extractHeaderMetadata(const Header& h, MetadataNode& forward, MetadataNode& m) |
| 84 | { |
| 85 | addForwardMetadata(forward, m, "major_version", h.versionMajor, |
| 86 | "The major LAS version for the file, always 1 for now"); |
| 87 | addForwardMetadata(forward, m, "minor_version", h.versionMinor, |
| 88 | "The minor LAS version for the file"); |
| 89 | addForwardMetadata(forward, m, "dataformat_id", h.pointFormat(), |
| 90 | "LAS Point Data Format"); |
| 91 | addForwardMetadata(forward, m, "filesource_id", h.fileSourceId, |
| 92 | "File Source ID (Flight Line Number if this file was derived from an original " |
| 93 | "flight line)."); |
| 94 | if (h.versionAtLeast(1, 2)) |
| 95 | { |
| 96 | // For some reason we've written global encoding as a base 64 |
| 97 | // encoded value in the past. In an effort to standardize things, |
| 98 | // I'm writing this as a special value, and will also write |
| 99 | // global_encoding like we write all other header metadata. |
| 100 | uint16_t globalEncoding = h.globalEncoding; |
| 101 | m.addEncoded("global_encoding_base64", (uint8_t *)&globalEncoding, sizeof(globalEncoding), |
| 102 | "Global Encoding: general property bit field."); |
| 103 | addForwardMetadata(forward, m, "global_encoding", h.globalEncoding, |
| 104 | "Global Encoding: general property bit field."); |
| 105 | } |
| 106 | |
| 107 | addForwardMetadata(forward, m, "project_id", h.projectGuid, "Project ID."); |
| 108 | addForwardMetadata(forward, m, "system_id", h.systemId, "Generating system ID."); |
| 109 | addForwardMetadata(forward, m, "software_id", h.softwareId, "Generating software description."); |
| 110 | addForwardMetadata(forward, m, "creation_doy", h.creationDoy, |
| 111 | "Day, expressed as an unsigned short, on which this file was created. " |
| 112 | "Day is computed as the Greenwich Mean Time (GMT) day. January 1 is " |
| 113 | "considered day 1."); |
| 114 | addForwardMetadata(forward, m, "creation_year", h.creationYear, |
| 115 | "The year, expressed as a four digit number, in which the file was created."); |
| 116 | addForwardMetadata(forward, m, "scale_x", h.scale.x, "The scale factor for X values.", 15); |
| 117 | addForwardMetadata(forward, m, "scale_y", h.scale.y, "The scale factor for Y values.", 15); |
| 118 | addForwardMetadata(forward, m, "scale_z", h.scale.z, "The scale factor for Z values.", 15); |
| 119 | addForwardMetadata(forward, m, "offset_x", h.offset.x, "The offset for X values.", 15); |
| 120 | addForwardMetadata(forward, m, "offset_y", h.offset.y, "The offset for Y values.", 15); |
| 121 | addForwardMetadata(forward, m, "offset_z", h.offset.z, "The offset for Z values.", 15); |
| 122 | |
| 123 | m.add<bool>("compressed", h.dataCompressed(), "true if this LAS file is compressed"); |
| 124 | m.add("point_length", h.pointSize, "The size, in bytes, of each point records."); |
| 125 | m.add("header_size", h.vlrOffset, |
| 126 | "The size, in bytes, of the header block, including any extension by specific software."); |
| 127 | m.add("dataoffset", h.pointOffset, |
| 128 | "The actual number of bytes from the beginning of the file to the " |
| 129 | "first field of the first point record data field. This data offset " |
| 130 | "must be updated if any software adds data from the Public Header " |
| 131 | "Block or adds/removes data to/from the Variable Length Records."); |
| 132 | m.add<double>("minx", h.bounds.minx, |
| 133 | "The max and min data fields are the actual unscaled extents of the " |
| 134 | "LAS point file data, specified in the coordinate system of the LAS " |
| 135 | "data."); |
| 136 | m.add<double>("miny", h.bounds.miny, |
| 137 | "The max and min data fields are the actual unscaled extents of the " |
| 138 | "LAS point file data, specified in the coordinate system of the LAS " |
| 139 | "data."); |
| 140 | m.add<double>("minz", h.bounds.minz, |
no test coverage detected