QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
|
This class wraps a request for features to a vector layer (or directly its vector data provider). More...
#include <qgsfeaturerequest.h>
Classes | |
class | OrderBy |
Represents a list of OrderByClauses, with the most important first and the least important last. More... | |
class | OrderByClause |
The OrderByClause class represents an order by clause for a QgsFeatureRequest. More... | |
Public Member Functions | |
QgsFeatureRequest () | |
construct a default request: for all features get attributes and geometries | |
QgsFeatureRequest (const QgsExpression &expr, const QgsExpressionContext &context=QgsExpressionContext()) | |
construct a request with a filter expression | |
QgsFeatureRequest (const QgsFeatureIds &fids) | |
construct a request with feature ID filter | |
QgsFeatureRequest (const QgsFeatureRequest &rh) | |
QgsFeatureRequest (const QgsRectangle &rectangle) | |
Construct a request with rectangle bounding box filter. | |
QgsFeatureRequest (QgsFeatureId fid) | |
construct a request with feature ID filter | |
~QgsFeatureRequest () | |
bool | acceptFeature (const QgsFeature &feature) |
Check if a feature is accepted by this requests filter. | |
QgsFeatureRequest & | addOrderBy (const QString &expression, bool ascending, bool nullsfirst) |
Adds a new OrderByClause, appending it as the least important one. | |
QgsFeatureRequest & | addOrderBy (const QString &expression, bool ascending=true) |
Adds a new OrderByClause, appending it as the least important one. | |
QgsCoordinateTransform | calculateTransform (const QgsCoordinateReferenceSystem &sourceCrs) const |
Calculates the coordinate transform to use to transform geometries when they are originally in sourceCrs. | |
QgsFeatureRequest & | combineFilterExpression (const QString &expression) |
Modifies the existing filter expression to add an additional expression filter. | |
bool | compare (const QgsFeatureRequest &other) const |
Compare two requests for equality, ignoring Expression Context, Transform Error Callback, Feedback and Invalid Geometry Callback. | |
Q_DECL_DEPRECATED int | connectionTimeout () const |
Returns the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool at this moment. | |
QgsCoordinateTransform | coordinateTransform () const |
Returns the coordinate transform which will be used to transform the feature's geometries. | |
QgsCoordinateReferenceSystem | destinationCrs () const |
Returns the destination coordinate reference system for feature's geometries, or an invalid QgsCoordinateReferenceSystem if no reprojection will be done and all features will be left with their original geometry. | |
QgsFeatureRequest & | disableFilter () |
Disables any attribute/ID filtering. | |
double | distanceWithin () const |
Returns the maximum distance from the referenceGeometry() of fetched features, if spatialFilterType() is Qgis::SpatialFilterType::DistanceWithin. | |
QgsExpressionContext * | expressionContext () |
Returns the expression context used to evaluate filter expressions. | |
QgsFeedback * | feedback () const |
Returns the feedback object that can be queried regularly by the iterator to check if it should be canceled, if set. | |
QgsExpression * | filterExpression () const |
Returns the filter expression (if set). | |
QgsFeatureId | filterFid () const |
Returns the feature ID that should be fetched. | |
const QgsFeatureIds & | filterFids () const |
Returns the feature IDs that should be fetched. | |
QgsRectangle | filterRect () const |
Returns the rectangle from which features will be taken. | |
Qgis::FeatureRequestFilterType | filterType () const |
Returns the attribute/ID filter type which is currently set on this request. | |
Qgis::FeatureRequestFlags | flags () const |
Returns the flags which affect how features are fetched. | |
std::function< void(const QgsFeature &) > | invalidGeometryCallback () const |
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck() is set to GeometryAbortOnInvalid or GeometrySkipInvalid. | |
Qgis::InvalidGeometryCheck | invalidGeometryCheck () const |
Returns the invalid geometry checking behavior. | |
long long | limit () const |
Returns the maximum number of features to request, or -1 if no limit set. | |
QgsFeatureRequest & | operator= (const QgsFeatureRequest &rh) |
OrderBy | orderBy () const |
Returns a list of order by clauses specified for this feature request. | |
QgsGeometry | referenceGeometry () const |
Returns the reference geometry used for spatial filtering of features. | |
std::shared_ptr< QgsGeometryEngine > | referenceGeometryEngine () const |
Returns the reference geometry engine used for spatial filtering of features. | |
bool | requestMayBeNested () const |
In case this request may be run nested within another already running iteration on the same connection, set this to true . | |
Q_DECL_DEPRECATED QgsFeatureRequest & | setConnectionTimeout (int connectionTimeout) |
Sets the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool at this moment. | |
QgsFeatureRequest & | setCoordinateTransform (const QgsCoordinateTransform &transform) |
Sets the coordinate transform which will be used to transform the feature's geometries. | |
QgsFeatureRequest & | setDestinationCrs (const QgsCoordinateReferenceSystem &crs, const QgsCoordinateTransformContext &context) |
Sets the destination crs for feature's geometries. | |
QgsFeatureRequest & | setDistanceWithin (const QgsGeometry &geometry, double distance) |
Sets a reference geometry and a maximum distance from this geometry to retrieve features within. | |
QgsFeatureRequest & | setExpressionContext (const QgsExpressionContext &context) |
Sets the expression context used to evaluate filter expressions. | |
void | setFeedback (QgsFeedback *feedback) |
Attach a feedback object that can be queried regularly by the iterator to check if it should be canceled. | |
QgsFeatureRequest & | setFilterExpression (const QString &expression) |
Set the filter expression. | |
QgsFeatureRequest & | setFilterFid (QgsFeatureId fid) |
Sets the feature ID that should be fetched. | |
QgsFeatureRequest & | setFilterFids (const QgsFeatureIds &fids) |
Sets the feature IDs that should be fetched. | |
QgsFeatureRequest & | setFilterRect (const QgsRectangle &rectangle) |
Sets the rectangle from which features will be taken. | |
QgsFeatureRequest & | setFlags (Qgis::FeatureRequestFlags flags) |
Sets flags that affect how features will be fetched. | |
QgsFeatureRequest & | setInvalidGeometryCallback (const std::function< void(const QgsFeature &)> &callback) |
Sets a callback function to use when encountering an invalid geometry and invalidGeometryCheck() is set to GeometryAbortOnInvalid or GeometrySkipInvalid. | |
QgsFeatureRequest & | setInvalidGeometryCheck (Qgis::InvalidGeometryCheck check) |
Sets invalid geometry checking behavior. | |
QgsFeatureRequest & | setLimit (long long limit) |
Set the maximum number of features to request. | |
QgsFeatureRequest & | setNoAttributes () |
Set that no attributes will be fetched. | |
QgsFeatureRequest & | setOrderBy (const OrderBy &orderBy) |
Set a list of order by clauses. | |
QgsFeatureRequest & | setRequestMayBeNested (bool requestMayBeNested) |
In case this request may be run nested within another already running iteration on the same connection, set this to true . | |
QgsFeatureRequest & | setSimplifyMethod (const QgsSimplifyMethod &simplifyMethod) |
Set a simplification method for geometries that will be fetched. | |
QgsFeatureRequest & | setSubsetOfAttributes (const QgsAttributeList &attrs) |
Set a subset of attributes that will be fetched. | |
QgsFeatureRequest & | setSubsetOfAttributes (const QSet< QString > &attrNames, const QgsFields &fields) |
Sets a subset of attributes by names that will be fetched. | |
QgsFeatureRequest & | setSubsetOfAttributes (const QStringList &attrNames, const QgsFields &fields) |
Sets a subset of attributes by names that will be fetched. | |
QgsFeatureRequest & | setTimeout (int timeout) |
Sets the timeout (in milliseconds) for the maximum time we should wait during feature requests before a feature is returned. | |
QgsFeatureRequest & | setTransformErrorCallback (const std::function< void(const QgsFeature &)> &callback) |
Sets a callback function to use when encountering a transform error when iterating features and a destinationCrs() is set. | |
const QgsSimplifyMethod & | simplifyMethod () const |
Returns the simplification method for geometries that will be fetched. | |
Qgis::SpatialFilterType | spatialFilterType () const |
Returns the spatial filter type which is currently set on this request. | |
QgsAttributeList | subsetOfAttributes () const |
Returns the subset of attributes which at least need to be fetched. | |
int | timeout () const |
Returns the timeout (in milliseconds) for the maximum time we should wait during feature requests before a feature is returned. | |
QgsCoordinateTransformContext | transformContext () const |
Returns the transform context, for use when a destinationCrs() has been set and reprojection is required. | |
std::function< void(const QgsFeature &) > | transformErrorCallback () const |
Returns the callback function to use when encountering a transform error when iterating features and a destinationCrs() is set. | |
Static Public Attributes | |
static const QString | ALL_ATTRIBUTES = QStringLiteral( "#!allattributes!#" ) |
A special attribute that if set matches all attributes. | |
This class wraps a request for features to a vector layer (or directly its vector data provider).
The request may apply an attribute/ID filter to fetch only a particular subset of features. Currently supported filters:
Additionally a spatial filter can be set in combination with the attribute/ID filter. Supported spatial filters are:
For efficiency, it is also possible to tell provider that some data is not required:
The options may be chained, e.g.:
Examples:
Definition at line 83 of file qgsfeaturerequest.h.
QgsFeatureRequest::QgsFeatureRequest | ( | ) |
construct a default request: for all features get attributes and geometries
Definition at line 26 of file qgsfeaturerequest.cpp.
|
explicit |
construct a request with feature ID filter
Definition at line 32 of file qgsfeaturerequest.cpp.
|
explicit |
construct a request with feature ID filter
Definition at line 38 of file qgsfeaturerequest.cpp.
|
explicit |
Construct a request with rectangle bounding box filter.
When a destination CRS is set using setDestinationCrs(), rectangle is expected to be in the same CRS as the destinationCrs(). Otherwise, rectangle should use the same CRS as the source layer/provider.
Definition at line 45 of file qgsfeaturerequest.cpp.
|
explicit |
construct a request with a filter expression
Definition at line 51 of file qgsfeaturerequest.cpp.
QgsFeatureRequest::QgsFeatureRequest | ( | const QgsFeatureRequest & | rh | ) |
Definition at line 58 of file qgsfeaturerequest.cpp.
|
default |
bool QgsFeatureRequest::acceptFeature | ( | const QgsFeature & | feature | ) |
Check if a feature is accepted by this requests filter.
feature | The feature which will be tested |
true
, if the filter accepts the feature Definition at line 366 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::addOrderBy | ( | const QString & | expression, |
bool | ascending, | ||
bool | nullsfirst | ||
) |
Adds a new OrderByClause, appending it as the least important one.
expression | The expression to use for ordering |
ascending | If the order should be ascending (1,2,3) or descending (3,2,1) |
nullsfirst | If true , NULLS are at the beginning, if false , NULLS are at the end |
Definition at line 228 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::addOrderBy | ( | const QString & | expression, |
bool | ascending = true |
||
) |
Adds a new OrderByClause, appending it as the least important one.
expression | The expression to use for ordering |
ascending | If the order should be ascending (1,2,3) or descending (3,2,1) If the order is ascending, by default nulls are last If the order is descending, by default nulls are first |
Definition at line 222 of file qgsfeaturerequest.cpp.
QgsCoordinateTransform QgsFeatureRequest::calculateTransform | ( | const QgsCoordinateReferenceSystem & | sourceCrs | ) | const |
Calculates the coordinate transform to use to transform geometries when they are originally in sourceCrs.
This method will return coordinateTransform() if it is set (ignoring sourceCrs), otherwise it will calculate an appriopriate transform from sourceCrs to destinationCrs().
Definition at line 334 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::combineFilterExpression | ( | const QString & | expression | ) |
Modifies the existing filter expression to add an additional expression filter.
The filter expressions are combined using AND, so only features matching both the existing expression and the additional expression will be returned.
Calling this method will automatically set filterType() to QgsFeatureRequest::FilterExpression.
Definition at line 203 of file qgsfeaturerequest.cpp.
bool QgsFeatureRequest::compare | ( | const QgsFeatureRequest & | other | ) | const |
Compare two requests for equality, ignoring Expression Context, Transform Error Callback, Feedback and Invalid Geometry Callback.
other | the other request |
true
if the requests are equal in all respects but without checking for Expression Context, Transform Error, Feedback and Invalid Geometry Callback Definition at line 103 of file qgsfeaturerequest.cpp.
int QgsFeatureRequest::connectionTimeout | ( | ) | const |
Returns the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool at this moment.
A negative value (which is set by default) will wait forever.
Definition at line 421 of file qgsfeaturerequest.cpp.
QgsCoordinateTransform QgsFeatureRequest::coordinateTransform | ( | ) | const |
Returns the coordinate transform which will be used to transform the feature's geometries.
If this transform is valid then it will always be used to transform features, regardless of the destinationCrs() setting or the underlying feature source's actual CRS.
Definition at line 319 of file qgsfeaturerequest.cpp.
QgsCoordinateReferenceSystem QgsFeatureRequest::destinationCrs | ( | ) | const |
Returns the destination coordinate reference system for feature's geometries, or an invalid QgsCoordinateReferenceSystem if no reprojection will be done and all features will be left with their original geometry.
Definition at line 324 of file qgsfeaturerequest.cpp.
|
inline |
Disables any attribute/ID filtering.
Calling this method will automatically set filterType() to QgsFeatureRequest::FilterNone.
Definition at line 567 of file qgsfeaturerequest.h.
|
inline |
Returns the maximum distance from the referenceGeometry() of fetched features, if spatialFilterType() is Qgis::SpatialFilterType::DistanceWithin.
When a destination CRS is set using setDestinationCrs(), the distance will be in the spatial units of destinationCrs(). Otherwise, the distance will use the same units as the CRS of the source layer/provider.
Definition at line 429 of file qgsfeaturerequest.h.
|
inline |
Returns the expression context used to evaluate filter expressions.
Definition at line 548 of file qgsfeaturerequest.h.
QgsFeedback * QgsFeatureRequest::feedback | ( | ) | const |
Returns the feedback object that can be queried regularly by the iterator to check if it should be canceled, if set.
Definition at line 459 of file qgsfeaturerequest.cpp.
|
inline |
Returns the filter expression (if set).
Definition at line 531 of file qgsfeaturerequest.h.
|
inline |
Returns the feature ID that should be fetched.
Definition at line 447 of file qgsfeaturerequest.h.
|
inline |
Returns the feature IDs that should be fetched.
Definition at line 465 of file qgsfeaturerequest.h.
QgsRectangle QgsFeatureRequest::filterRect | ( | ) | const |
Returns the rectangle from which features will be taken.
If the returned rectangle is null, then no filter rectangle is set.
If spatialFilterType() is Qgis::SpatialFilterType::BoundingBox then only features from within this bounding box will be fetched. If spatialFilterType() is Qgis::SpatialFilterType::DistanceWithin then the returned rectangle represents the bounding box of the referenceGeometry() extended by distanceWithin().
When a destination CRS is set using setDestinationCrs(), the rectangle will be in the same CRS as the destinationCrs(). Otherwise, the rectangle will use the same CRS as the source layer/provider.
Definition at line 146 of file qgsfeaturerequest.cpp.
|
inline |
Returns the attribute/ID filter type which is currently set on this request.
This type will automatically be set to the appropriate value whenever setFilterFid(), setFilterFids(), setFilterExpression() or disableFilter() are called.
Definition at line 328 of file qgsfeaturerequest.h.
|
inline |
Returns the flags which affect how features are fetched.
Definition at line 632 of file qgsfeaturerequest.h.
|
inline |
Returns the callback function to use when encountering an invalid geometry and invalidGeometryCheck() is set to GeometryAbortOnInvalid or GeometrySkipInvalid.
Definition at line 513 of file qgsfeaturerequest.h.
|
inline |
Returns the invalid geometry checking behavior.
Definition at line 479 of file qgsfeaturerequest.h.
|
inline |
Returns the maximum number of features to request, or -1 if no limit set.
Definition at line 615 of file qgsfeaturerequest.h.
QgsFeatureRequest & QgsFeatureRequest::operator= | ( | const QgsFeatureRequest & | rh | ) |
Definition at line 63 of file qgsfeaturerequest.cpp.
QgsFeatureRequest::OrderBy QgsFeatureRequest::orderBy | ( | ) | const |
Returns a list of order by clauses specified for this feature request.
Definition at line 234 of file qgsfeaturerequest.cpp.
|
inline |
Returns the reference geometry used for spatial filtering of features.
When spatialFilterType() is Qgis::SpatialFilterType::DistanceWithin then only features within distanceWithin() units of the reference geometry will be fetched.
When a destination CRS is set using setDestinationCrs(), the geometry will be in the same CRS as the destinationCrs(). Otherwise, the geometry will use the same CRS as the source layer/provider.
Definition at line 406 of file qgsfeaturerequest.h.
|
inline |
Returns the reference geometry engine used for spatial filtering of features.
This is to avoid re-creating the engine.
Definition at line 416 of file qgsfeaturerequest.h.
bool QgsFeatureRequest::requestMayBeNested | ( | ) | const |
In case this request may be run nested within another already running iteration on the same connection, set this to true
.
If this flag is true
, this request will be able to make use of "spare" connections to avoid deadlocks.
For example, this should be set on requests that are issued from an expression function.
Definition at line 443 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setConnectionTimeout | ( | int | connectionTimeout | ) |
Sets the timeout (in milliseconds) for how long we should wait for a connection if none is available from the pool at this moment.
A negative value (which is set by default) will wait forever.
Definition at line 426 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setCoordinateTransform | ( | const QgsCoordinateTransform & | transform | ) |
Sets the coordinate transform which will be used to transform the feature's geometries.
If this transform is valid then it will always be used to transform features, regardless of the destinationCrs() setting or the underlying feature source's actual CRS.
When a transform is set using setCoordinateTransform(), then any filterRect() or referenceGeometry() set on the request is expected to be in the same CRS as the destination CRS for the transform.
The feature geometry transformation is performed after all filter expressions are tested and any virtual fields are calculated. Accordingly, any geometric expressions used in filterExpression() will be performed in the original source CRS. This ensures consistent results are returned regardless of the destination CRS. Similarly, virtual field values will be calculated using the original geometry in the source CRS, so these values are not affected by any destination CRS transform present in the feature request.
Definition at line 347 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setDestinationCrs | ( | const QgsCoordinateReferenceSystem & | crs, |
const QgsCoordinateTransformContext & | context | ||
) |
Sets the destination crs for feature's geometries.
If set, all geometries will be reprojected from their original coordinate reference system to this desired reference system. If crs is an invalid QgsCoordinateReferenceSystem then no reprojection will be done and all features will be left with their original geometry.
When a crs is set using setDestinationCrs(), then any filterRect() or referenceGeometry() set on the request is expected to be in the same CRS as the destination CRS.
The feature geometry transformation to the destination CRS is performed after all filter expressions are tested and any virtual fields are calculated. Accordingly, any geometric expressions used in filterExpression() will be performed in the original source CRS. This ensures consistent results are returned regardless of the destination CRS. Similarly, virtual field values will be calculated using the original geometry in the source CRS, so these values are not affected by any destination CRS transform present in the feature request.
Definition at line 353 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setDistanceWithin | ( | const QgsGeometry & | geometry, |
double | distance | ||
) |
Sets a reference geometry and a maximum distance from this geometry to retrieve features within.
When a destination CRS is set using setDestinationCrs(), geometry is expected to be in the same CRS as the destinationCrs() and distance is in the spatial units of the destinationCrs(). Otherwise, geometry should use the same CRS as the source layer/provider and distance should use the spatial units as this same CRS.
Calling this method will automatically set spatialFilterType() to Qgis::SpatialFilterType::DistanceWithin.
Definition at line 151 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setExpressionContext | ( | const QgsExpressionContext & | context | ) |
Sets the expression context used to evaluate filter expressions.
Definition at line 216 of file qgsfeaturerequest.cpp.
void QgsFeatureRequest::setFeedback | ( | QgsFeedback * | feedback | ) |
Attach a feedback object that can be queried regularly by the iterator to check if it should be canceled.
Ownership of feedback is NOT transferred, and the caller must take care that it exists for the lifetime of the feature request and feature iterators.
Definition at line 454 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setFilterExpression | ( | const QString & | expression | ) |
Set the filter expression.
{
expression | expression string |
Calling this method will automatically set filterType() to QgsFeatureRequest::FilterExpression.
Definition at line 196 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setFilterFid | ( | QgsFeatureId | fid | ) |
Sets the feature ID that should be fetched.
Calling this method will automatically set filterType() to QgsFeatureRequest::FilterFid.
Definition at line 170 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setFilterFids | ( | const QgsFeatureIds & | fids | ) |
Sets the feature IDs that should be fetched.
Calling this method will automatically set filterType() to QgsFeatureRequest::FilterFids.
Definition at line 177 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setFilterRect | ( | const QgsRectangle & | rectangle | ) |
Sets the rectangle from which features will be taken.
An empty rectangle removes the filter.
When a destination CRS is set using setDestinationCrs(), rectangle is expected to be in the same CRS as the destinationCrs(). Otherwise, rectangle should use the same CRS as the source layer/provider.
Calling this method will automatically set spatialFilterType() to Qgis::SpatialFilterType::BoundingBox. If rectangle is a null rectangle then spatialFilterType() will be reset to Qgis::SpatialFilterType::NoFilter.
Definition at line 130 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setFlags | ( | Qgis::FeatureRequestFlags | flags | ) |
Sets flags that affect how features will be fetched.
Definition at line 251 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setInvalidGeometryCallback | ( | const std::function< void(const QgsFeature &)> & | callback | ) |
Sets a callback function to use when encountering an invalid geometry and invalidGeometryCheck() is set to GeometryAbortOnInvalid or GeometrySkipInvalid.
This function will be called using the feature with invalid geometry as a parameter.
Definition at line 190 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setInvalidGeometryCheck | ( | Qgis::InvalidGeometryCheck | check | ) |
Sets invalid geometry checking behavior.
Definition at line 184 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setLimit | ( | long long | limit | ) |
Set the maximum number of features to request.
limit | maximum number of features, or -1 to request all features. |
Definition at line 245 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setNoAttributes | ( | ) |
Set that no attributes will be fetched.
To revert a call to setNoAttributes and fetch all or some available attributes, the SubsetOfAttributes flag should be removed from the request.
Definition at line 264 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setOrderBy | ( | const OrderBy & | orderBy | ) |
Set a list of order by clauses.
Definition at line 239 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setRequestMayBeNested | ( | bool | requestMayBeNested | ) |
In case this request may be run nested within another already running iteration on the same connection, set this to true
.
If this flag is true
, this request will be able to make use of "spare" connections to avoid deadlocks.
For example, this should be set on requests that are issued from an expression function.
Definition at line 448 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setSimplifyMethod | ( | const QgsSimplifyMethod & | simplifyMethod | ) |
Set a simplification method for geometries that will be fetched.
Definition at line 313 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setSubsetOfAttributes | ( | const QgsAttributeList & | attrs | ) |
Set a subset of attributes that will be fetched.
An empty attributes list indicates that no attributes will be fetched. To revert a call to setSubsetOfAttributes and fetch all available attributes, the SubsetOfAttributes flag should be removed from the request.
Definition at line 257 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setSubsetOfAttributes | ( | const QSet< QString > & | attrNames, |
const QgsFields & | fields | ||
) |
Sets a subset of attributes by names that will be fetched.
Definition at line 291 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setSubsetOfAttributes | ( | const QStringList & | attrNames, |
const QgsFields & | fields | ||
) |
Sets a subset of attributes by names that will be fetched.
Definition at line 269 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setTimeout | ( | int | timeout | ) |
Sets the timeout (in milliseconds) for the maximum time we should wait during feature requests before a feature is returned.
A negative value (which is set by default) will wait forever.
Definition at line 437 of file qgsfeaturerequest.cpp.
QgsFeatureRequest & QgsFeatureRequest::setTransformErrorCallback | ( | const std::function< void(const QgsFeature &)> & | callback | ) |
Sets a callback function to use when encountering a transform error when iterating features and a destinationCrs() is set.
This function will be called using the feature which encountered the transform error as a parameter.
Definition at line 360 of file qgsfeaturerequest.cpp.
|
inline |
Returns the simplification method for geometries that will be fetched.
Definition at line 722 of file qgsfeaturerequest.h.
|
inline |
Returns the spatial filter type which is currently set on this request.
This type will automatically be set to the appropriate value whenever setFilterRect(), or setDistanceWithin() are called.
Definition at line 342 of file qgsfeaturerequest.h.
|
inline |
Returns the subset of attributes which at least need to be fetched.
Definition at line 682 of file qgsfeaturerequest.h.
int QgsFeatureRequest::timeout | ( | ) | const |
Returns the timeout (in milliseconds) for the maximum time we should wait during feature requests before a feature is returned.
A negative value (which is set by default) will wait forever.
Definition at line 432 of file qgsfeaturerequest.cpp.
QgsCoordinateTransformContext QgsFeatureRequest::transformContext | ( | ) | const |
Returns the transform context, for use when a destinationCrs() has been set and reprojection is required.
Definition at line 329 of file qgsfeaturerequest.cpp.
|
inline |
Returns the callback function to use when encountering a transform error when iterating features and a destinationCrs() is set.
Definition at line 866 of file qgsfeaturerequest.h.
|
static |
A special attribute that if set matches all attributes.
Definition at line 284 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1013 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1021 of file qgsfeaturerequest.h.
|
protected |
Maximum distance from reference geometry.
Definition at line 1006 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1011 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1025 of file qgsfeaturerequest.h.
|
protected |
Attribute/ID filter type.
Definition at line 979 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1010 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1008 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1009 of file qgsfeaturerequest.h.
|
protected |
Bounding box for spatial filtering.
Definition at line 991 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1012 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1018 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1017 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1015 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1016 of file qgsfeaturerequest.h.
|
protected |
Reference geometry for Qgis::RequestSpatialFilter::DistanceWithin filtering.
Definition at line 996 of file qgsfeaturerequest.h.
|
protected |
Prepared geometry engine for mReferenceGeometry.
Definition at line 1001 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1024 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1014 of file qgsfeaturerequest.h.
|
protected |
|
protected |
Definition at line 1023 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1020 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1022 of file qgsfeaturerequest.h.
|
protected |
Definition at line 1019 of file qgsfeaturerequest.h.