Last active
August 29, 2015 14:11
-
-
Save luipir/fcbc318304944962dfec to your computer and use it in GitHub Desktop.
mutual exclusivity in QgsFeatureRequest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myVector = iface.activeLayer() # alaska.shp in qgis_sample_data | |
# iteration getting only selected features | |
rect = QgsRectangle( 1223070.695, 2293653.357 , 9046974.211, 4184988.662) | |
request = QgsFeatureRequest() | |
request.setSubsetOfAttributes([0, 2]) | |
request.setFilterExpression('"AREA_MI" > 1000') | |
request.setFilterRect( rect ) | |
for index, feature in enumerate( myVector.getFeatures( request ) ): | |
print "The record %d has ID %d" % ( index, feature.id() ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment