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

Method polygons

pdal/Polygon.cpp:337–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337std::vector<Polygon> Polygon::polygons() const
338{
339 std::vector<Polygon> polys;
340
341 OGRwkbGeometryType t = m_geom->getGeometryType();
342
343 if (t == wkbPolygon || t == wkbPolygon25D)
344 polys.emplace_back(*this);
345 else if (t == wkbMultiPolygon || t == wkbMultiPolygon25D)
346 {
347 // Not until GDAL 2.3
348 /**
349 OGRMultiPolygon *mPoly = m_geom->toMultiPolygon();
350 for (auto it = mPoly->begin(); it != mPoly->end(); ++it)
351 {
352 Polygon p;
353 p.m_geom.reset((*it)->clone());
354 polys.push_back(p);
355 }
356 **/
357 OGRMultiPolygon *mPoly = static_cast<OGRMultiPolygon *>(m_geom.get());
358 for (int i = 0; i < mPoly->getNumGeometries(); ++i)
359 {
360 Polygon p;
361 p.m_geom.reset(mPoly->getGeometryRef(i)->clone());
362 polys.push_back(p);
363 }
364 }
365 return polys;
366}
367
368
369Polygon::Ring Polygon::exteriorRing() const

Callers 3

createSpatialFiltersMethod · 0.80
initializeMethod · 0.80
transformMethod · 0.80

Calls 2

getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected