mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix outdated example code, convert to python
(because c++ devs are l33t and don't need examples...)
This commit is contained in:
parent
fdaa57a273
commit
1e7d479321
@ -31,19 +31,25 @@ For efficiency, it is also possible to tell provider that some data is not requi
|
||||
- SimplifyMethod for geometries to fetch
|
||||
|
||||
The options may be chained, e.g.:
|
||||
QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1)).setFlags(QgsFeatureRequest.ExactIntersect)
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1)).setFlags(QgsFeatureRequest.ExactIntersect)
|
||||
|
||||
Examples:
|
||||
- fetch all features:
|
||||
QgsFeatureRequest()
|
||||
- fetch all features, only one attribute
|
||||
QgsFeatureRequest().setSubsetOfAttributes(QStringList("myfield"), provider->fieldMap())
|
||||
- fetch all features, without geometries
|
||||
QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
|
||||
- fetch only features from particular extent
|
||||
QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1))
|
||||
- fetch only one feature
|
||||
QgsFeatureRequest().setFilterFid(45)
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
# fetch all features:
|
||||
QgsFeatureRequest()
|
||||
# fetch all features, only one attribute
|
||||
QgsFeatureRequest().setSubsetOfAttributes(['myfield'], layer.fields())
|
||||
# fetch all features, without geometries
|
||||
QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
|
||||
# fetch only features from particular extent
|
||||
QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1))
|
||||
# fetch only one feature
|
||||
QgsFeatureRequest().setFilterFid(45)
|
||||
%End
|
||||
|
||||
%TypeHeaderCode
|
||||
|
@ -49,20 +49,25 @@
|
||||
* - SimplifyMethod for geometries to fetch
|
||||
*
|
||||
* The options may be chained, e.g.:
|
||||
* QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1)).setFlags(QgsFeatureRequest::ExactIntersect)
|
||||
*
|
||||
* \code{.py}
|
||||
* QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1)).setFlags(QgsFeatureRequest.ExactIntersect)
|
||||
* \endcode
|
||||
*
|
||||
* Examples:
|
||||
* - fetch all features:
|
||||
* QgsFeatureRequest()
|
||||
* - fetch all features, only one attribute
|
||||
* QgsFeatureRequest().setSubsetOfAttributes(QStringList("myfield"), provider->fieldMap())
|
||||
* - fetch all features, without geometries
|
||||
* QgsFeatureRequest().setFlags(QgsFeatureRequest::NoGeometry)
|
||||
* - fetch only features from particular extent
|
||||
* QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1))
|
||||
* - fetch only one feature
|
||||
* QgsFeatureRequest().setFilterFid(45)
|
||||
*
|
||||
* \code{.py}
|
||||
* # fetch all features:
|
||||
* QgsFeatureRequest()
|
||||
* # fetch all features, only one attribute
|
||||
* QgsFeatureRequest().setSubsetOfAttributes(['myfield'], layer.fields())
|
||||
* # fetch all features, without geometries
|
||||
* QgsFeatureRequest().setFlags(QgsFeatureRequest.NoGeometry)
|
||||
* # fetch only features from particular extent
|
||||
* QgsFeatureRequest().setFilterRect(QgsRectangle(0,0,1,1))
|
||||
* # fetch only one feature
|
||||
* QgsFeatureRequest().setFilterFid(45)
|
||||
* \endcode
|
||||
*/
|
||||
class CORE_EXPORT QgsFeatureRequest
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user