| 57 | { |
| 58 | |
| 59 | void collectPath(const hexer::Path& path, OGRGeometryH polygon) |
| 60 | { |
| 61 | OGRGeometryH ring = OGR_G_CreateGeometry(wkbLinearRing); |
| 62 | |
| 63 | for (const hexer::Point& p : path.points()) |
| 64 | OGR_G_AddPoint_2D(ring, p.m_x, p.m_y); |
| 65 | |
| 66 | if( OGR_G_AddGeometryDirectly(polygon, ring) != OGRERR_NONE ) |
| 67 | { |
| 68 | std::ostringstream oss; |
| 69 | oss << "Unable to add geometry with error '" << |
| 70 | CPLGetLastErrorMsg() << "'"; |
| 71 | throw pdal::pdal_error(oss.str()); |
| 72 | } |
| 73 | |
| 74 | for (const hexer::Path *path : path.subPaths()) |
| 75 | collectPath(*path, polygon); |
| 76 | } |
| 77 | |
| 78 | OGRGeometryH collectHexagon(hexer::HexId const& id, hexer::BaseGrid& grid) |
| 79 | { |
no test coverage detected