38 QLinkedList<const GEOSGeometry *> *queue =
new QLinkedList<const GEOSGeometry *>;
39 QLinkedList<const GEOSGeometry *> *final_queue =
new QLinkedList<const GEOSGeometry *>;
43 queue->append( the_geom );
49 while ( !queue->isEmpty() )
51 geom = queue->takeFirst();
52 const int type = GEOSGeomTypeId_r( geosctxt, geom );
56 case GEOS_MULTILINESTRING:
57 case GEOS_MULTIPOLYGON:
58 case GEOS_GEOMETRYCOLLECTION:
59 nGeom = GEOSGetNumGeometries_r( geosctxt, geom );
60 for ( i = 0; i < nGeom; i++ )
62 queue->append( GEOSGetGeometryN_r( geosctxt, geom, i ) );
68 final_queue->append( geom );
71 QgsDebugError( QStringLiteral(
"unexpected geometry type:%1" ).arg( type ) );
static GEOSContextHandle_t get()
Returns a thread local instance of a GEOS context, safe for use in the current thread.