-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
Also speed up avoid intersections by removing unnecessary geometry cloning
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -333,14 +333,17 @@ QgsAbstractGeometry *QgsGeos::combine( const QgsAbstractGeometry *geom, QString | |
return overlay( geom, UNION, errorMsg ).release(); | ||
} | ||
|
||
QgsAbstractGeometry *QgsGeos::combine( const QList<QgsAbstractGeometry *> &geomList, QString *errorMsg ) const | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
nyalldawson
Author
Collaborator
|
||
QgsAbstractGeometry *QgsGeos::combine( const QList<QgsGeometry> &geomList, QString *errorMsg ) const | ||
{ | ||
|
||
QVector< GEOSGeometry * > geosGeometries; | ||
geosGeometries.resize( geomList.size() ); | ||
for ( int i = 0; i < geomList.size(); ++i ) | ||
geosGeometries.reserve( geomList.size() ); | ||
for ( const QgsGeometry &g : geomList ) | ||
{ | ||
geosGeometries[i] = asGeos( geomList.at( i ), mPrecision ); | ||
if ( !g ) | ||
continue; | ||
|
||
geosGeometries << asGeos( g.geometry(), mPrecision ); | ||
} | ||
|
||
GEOSGeometry *geomUnion = nullptr; | ||
|
@nyalldawson What's the reason behind this change? It pretty much does the opposite of speeding up things in the geometry checker because I now need to construct a QgsGeometry for each geometry to combine, instead of just being able to pass the QgsAbstractGeometries which I already have.