Skip to content
Permalink
Browse files

Use iterator for parts

  • Loading branch information
m-kuhn committed Jan 19, 2019
1 parent 4c8af20 commit 0b248dc80112267db2b77f1e5cb2a5c776e2e9c4
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/analysis/processing/qgsalgorithmpolygonstolines.cpp
@@ -75,6 +75,8 @@ QList<int> QgsPolygonsToLinesAlgorithm::inputLayerTypes() const

QgsFeatureList QgsPolygonsToLinesAlgorithm::processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback * )
{
Q_UNUSED( context )

QgsFeatureList result;
QgsFeature feat = feature;
if ( feat.hasGeometry() )
@@ -126,10 +128,9 @@ QList<QgsCurve *> QgsPolygonsToLinesAlgorithm::extractRings( const QgsAbstractGe

if ( QgsGeometryCollection *collection = qgsgeometry_cast<QgsGeometryCollection *>( geom ) )
{
for ( int i = 0; i < collection->numGeometries(); ++i )
{
rings.append( extractRings( collection->geometryN( i ) ) );
}
QgsGeometryPartIterator parts = collection->parts();
while ( parts.hasNext() )
rings.append( extractRings( parts.next() ) );
}
else if ( QgsCurvePolygon *polygon = qgsgeometry_cast<QgsCurvePolygon *>( geom ) )
{

0 comments on commit 0b248dc

Please sign in to comment.
You can’t perform that action at this time.