| 117 | } |
| 118 | |
| 119 | StringList Header::validate(uint64_t fileSize) const |
| 120 | { |
| 121 | StringList errors; |
| 122 | |
| 123 | if (magic != "LASF") |
| 124 | errors.push_back("Invalid file signature. Was expecting 'LASF', Check the first four " |
| 125 | " bytes of the file."); |
| 126 | if (!dataCompressed() && (pointOffset > fileSize)) |
| 127 | errors.push_back("Invalid point offset - exceeds file size."); |
| 128 | if (!dataCompressed() && (pointOffset + pointCount() * pointSize > fileSize)) |
| 129 | errors.push_back("Invalid point count: " + std::to_string(pointCount()) + |
| 130 | ". Number of points too large for file size."); |
| 131 | if (vlrOffset > fileSize) |
| 132 | errors.push_back("Invalid VLR offset - exceeds file size."); |
| 133 | if (!pointFormatSupported(pointFormat())) |
| 134 | errors.push_back("Unsupported LAS input point format: " + |
| 135 | Utils::toString((int)pointFormat()) + "."); |
| 136 | if (pointSize < baseCount()) |
| 137 | errors.push_back("Invalid point size of " + std::to_string(pointSize) + |
| 138 | ". Less than minimum required for point format " + |
| 139 | std::to_string((int)pointFormat()) + "."); |
| 140 | if (versionMajor != 1 || versionMinor > 4) |
| 141 | errors.push_back("Unsupported LAS version '" + std::to_string(versionMajor) + "." + |
| 142 | std::to_string(versionMinor) + "'."); |
| 143 | return errors; |
| 144 | } |
| 145 | |
| 146 | void Header::setPointCount(uint64_t pointCount) |
| 147 | { |
nothing calls this directly
no test coverage detected