MCPcopy Create free account
hub / github.com/PDAL/PDAL / interiorRings

Method interiorRings

pdal/Polygon.cpp:394–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392
393
394std::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

Callers 2

transformMethod · 0.80
initGridsMethod · 0.80

Calls 2

getMethod · 0.45
getNumPointsMethod · 0.45

Tested by

no test coverage detected