Advertisement
Guest User

Untitled

a guest
Nov 28th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.       //search vertex
  3.       mMultiPartGeometry = true;
  4.       int vertex = match.vertexIndex();
  5.       int currentVertex = 0;
  6.       QgsMultiPolygonXY multiPoly = geom.asMultiPolygon();
  7.       QgsMultiPolygonXY::const_iterator multiPolyIt = multiPoly.constBegin();
  8.       for ( ; multiPolyIt != multiPoly.constEnd(); ++multiPolyIt )
  9.       {
  10.         QgsPolygonXY::const_iterator polyIt = multiPolyIt->constBegin();
  11.         for ( ; polyIt != multiPolyIt->constEnd(); ++polyIt )
  12.         {
  13.           currentVertex += polyIt->size();
  14.           if ( vertex < currentVertex )
  15.           {
  16.             mOriginalGeometryPart = QgsGeometry::fromPolygonXY( *polyIt );
  17.             break;
  18.           }
  19.           mMultiPartGeometryIndex++;
  20.         }
  21.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement