| 122 | } |
| 123 | |
| 124 | void DracoWriter::parseQuants() |
| 125 | { |
| 126 | if (!m_userQuant.is_object()) { |
| 127 | if (std::string(m_userQuant.type_name()) == "null") return; |
| 128 | throw pdal_error("Option 'quantization' must be a JSON object, not a " + |
| 129 | std::string(m_userQuant.type_name())); |
| 130 | } |
| 131 | //Quantization levels are available for POSITION, NORMAL, TEX_COORD, COLOR, |
| 132 | //and GENERIC draco types |
| 133 | for (auto& entry : m_userQuant.items()) { |
| 134 | const std::string attribute = entry.key(); |
| 135 | const int quant = entry.value().get<int>(); |
| 136 | if (m_quant.find(attribute) == m_quant.end()) |
| 137 | throw pdal_error("Quantization attribute " + attribute + |
| 138 | " is not a valid Draco Geometry Attribute"); |
| 139 | m_quant[attribute] = quant; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | |
| 144 | DracoWriter::DimensionInfo *DracoWriter::findDimInfo(draco::GeometryAttribute::Type dt) { |