Guest User

Untitled

a guest
Aug 19th, 2019
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. roadlist=[]
  2. layer = iface.activeLayer()
  3.  
  4. for feature in layer.getFeatures():
  5. if feature['RoadMntnc'] not in roadlist:
  6. roadlist.append(feature['RoadMntnc'])
  7.  
  8. for road in roadlist:
  9. print (road)
  10. layer.selectByExpression('"RoadMntnc"= road', QgsVectorLayer.SetSelection)
  11. selection=layer.selectedFeatures()
  12. for feature in selection:
  13. print (feature['chainage'])
  14.  
  15. layer.selectByExpression('"RoadMntnc"= road', QgsVectorLayer.SetSelection)
RAW Paste Data