This will give positive bounds to default data type for id.
| 222 | |
| 223 | // This will give positive bounds to default data type for id. |
| 224 | std::pair<uint64_t, uint64_t> getPdalBounds(pdal::Dimension::Id id) |
| 225 | { |
| 226 | // pdal::Dimension::size() returns number of bytes for the |
| 227 | // pdal::Dimesion::Type. |
| 228 | // eg: 1 for uint8, 2 for uint16, 4 for uint32, 8 for double, etc. |
| 229 | // Max range for data type = (2 ^ (8 * no. of bytes)) - 1 |
| 230 | auto type = pdal::Dimension::defaultType(id); |
| 231 | auto typeName = pdal::Dimension::interpretationName(type); |
| 232 | if (typeName.find("uint") == 0) |
| 233 | { |
| 234 | uint64_t maxVal = ~0; |
| 235 | maxVal = maxVal >> (sizeof(uint64_t) - pdal::Dimension::size(type)) * CHAR_BIT; |
| 236 | return {0, maxVal}; |
| 237 | } |
| 238 | throw pdal_error("Cannot retrieve bounds for : " + typeName); |
| 239 | } |
| 240 | |
| 241 | point_count_t numPoints(const e57::VectorNode data3D) |
| 242 | { |