42 QLinkedList<const GEOSGeometry *> *queue =
new QLinkedList<const GEOSGeometry *>;
43 QLinkedList<const GEOSGeometry *> *final_queue =
new QLinkedList<const GEOSGeometry *>;
45 const GEOSGeometry *geom =
nullptr;
47 queue->append( the_geom );
53 while ( !queue->isEmpty() )
55 geom = queue->takeFirst();
56 int type = GEOSGeomTypeId_r( geosctxt, geom );
60 case GEOS_MULTILINESTRING:
61 case GEOS_MULTIPOLYGON:
62 case GEOS_GEOMETRYCOLLECTION:
63 nGeom = GEOSGetNumGeometries_r( geosctxt, geom );
64 for ( i = 0; i < nGeom; i++ )
66 queue->append( GEOSGetGeometryN_r( geosctxt, geom, i ) );
72 final_queue->append( geom );
75 QgsDebugMsg( QStringLiteral(
"unexpected geometry type:%1" ).arg( type ) );