| 392 | |
| 393 | |
| 394 | std::vector<Polygon::Ring> Polygon::interiorRings() const |
| 395 | { |
| 396 | std::vector<Ring> rings; |
| 397 | |
| 398 | OGRwkbGeometryType t = m_geom->getGeometryType(); |
| 399 | if (t != wkbPolygon && t != wkbPolygon25D) |
| 400 | throw pdal_error("Request for exterior ring on non-polygon."); |
| 401 | |
| 402 | // OGRPolygon *poly = m_geom->toPolygon(); |
| 403 | OGRPolygon *poly = static_cast<OGRPolygon *>(m_geom.get()); |
| 404 | for (int i = 0; i < poly->getNumInteriorRings(); ++i) |
| 405 | { |
| 406 | OGRLinearRing *er = poly->getInteriorRing(i); |
| 407 | |
| 408 | Ring r; |
| 409 | for (int j = 0; j < er->getNumPoints(); ++j) |
| 410 | r.push_back({er->getX(j), er->getY(j)}); |
| 411 | rings.push_back(r); |
| 412 | } |
| 413 | return rings; |
| 414 | } |
| 415 | |
| 416 | } // namespace pdal |
no test coverage detected