QgsFeature is a class in the QGIS API that represents a single feature in vector data. The id property is an integer value that uniquely identifies the feature within its layer.
Example 1: Retrieving the id of a feature
QgsFeature feature;
int id = feature.id();
In this example, the id property of the QgsFeature object named "feature" is retrieved and stored in the integer variable "id".
Example 2: Setting the id of a feature
QgsFeature feature;
feature.setId(10);
In this example, the id property of the QgsFeature object named "feature" is set to 10.
Package/library: QGIS API
C++ (Cpp) QgsFeature::id - 30 examples found. These are the top rated real world C++ (Cpp) examples of QgsFeature::id extracted from open source projects. You can rate examples to help us improve the quality of examples.