| 197 | |
| 198 | |
| 199 | bool ReprojectionFilter::processOne(PointRef& point) |
| 200 | { |
| 201 | double x(point.getFieldAs<double>(Dimension::Id::X)); |
| 202 | double y(point.getFieldAs<double>(Dimension::Id::Y)); |
| 203 | double z(point.getFieldAs<double>(Dimension::Id::Z)); |
| 204 | |
| 205 | bool ok = m_transform->transform(x, y, z); |
| 206 | if (ok) |
| 207 | { |
| 208 | point.setField(Dimension::Id::X, x); |
| 209 | point.setField(Dimension::Id::Y, y); |
| 210 | point.setField(Dimension::Id::Z, z); |
| 211 | } |
| 212 | else if (m_errorOnFailure) |
| 213 | throwError("Couldn't reproject point with X/Y/Z coordinates of (" + |
| 214 | std::to_string(point.getFieldAs<double>(Dimension::Id::X)) + ", " + |
| 215 | std::to_string(point.getFieldAs<double>(Dimension::Id::Y)) + ", " + |
| 216 | std::to_string(point.getFieldAs<double>(Dimension::Id::Z)) + ")."); |
| 217 | return ok; |
| 218 | } |
| 219 | |
| 220 | } // namespace pdal |