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

Method validate

io/private/las/Header.cpp:119–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119StringList 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
146void Header::setPointCount(uint64_t pointCount)
147{

Callers

nothing calls this directly

Calls 4

pointCountFunction · 0.85
pointFormatSupportedFunction · 0.85
baseCountFunction · 0.85
toStringFunction · 0.50

Tested by

no test coverage detected