Advertisement
Guest User

Untitled

a guest
May 24th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. layer = qgis.utils.iface.activeLayer()
  2. initial_features = []
  3. new_features = []
  4. # Get initial count of features
  5. for feat in layer.getFeatures():
  6. initial_features.append(len([feat]))
  7.  
  8. print sum(initial_features), "initial features"
  9.  
  10. # After creating features, use following to subtract new count of features with initial count
  11. for feat in layer.getFeatures():
  12. new_features.append(len([feat]))
  13.  
  14. print sum(new_features) - sum(initial_features), "new features"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement