Skip to content
Permalink
Browse files
Have QgsFeatureRequest store ref geometry engine by shared pointer
This reduces the number of GEOS conversions and preparations
upon copying the request (for example by QgsDistanceWithinAlgorithm)
  • Loading branch information
strk committed Oct 18, 2021
1 parent ccba5d9 commit ba7cdded4a2e9aad3aa7d1b1c9c2b9c0e2644d97
Showing with 2 additions and 6 deletions.
  1. +1 −5 src/core/qgsfeaturerequest.cpp
  2. +1 −1 src/core/qgsfeaturerequest.h
@@ -70,11 +70,7 @@ QgsFeatureRequest &QgsFeatureRequest::operator=( const QgsFeatureRequest &rh )
mSpatialFilter = rh.mSpatialFilter;
mFilterRect = rh.mFilterRect;
mReferenceGeometry = rh.mReferenceGeometry;
if ( !mReferenceGeometry.isEmpty() )
{
mReferenceGeometryEngine.reset( QgsGeometry::createGeometryEngine( mReferenceGeometry.constGet() ) );
mReferenceGeometryEngine->prepareGeometry();
}
mReferenceGeometryEngine = rh.mReferenceGeometryEngine;
mDistanceWithin = rh.mDistanceWithin;
mFilterFid = rh.mFilterFid;
mFilterFids = rh.mFilterFids;
@@ -947,7 +947,7 @@ class CORE_EXPORT QgsFeatureRequest
/**
* Prepared geometry engine for mReferenceGeometry.
*/
std::unique_ptr< QgsGeometryEngine > mReferenceGeometryEngine;
std::shared_ptr< QgsGeometryEngine > mReferenceGeometryEngine;

/**
* Maximum distance from reference geometry.

0 comments on commit ba7cdde

Please sign in to comment.