Guest User

Untitled

a guest
Dec 10th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. layer = iface.activeLayer()
  2. print(layer)
  3. all_features = layer.getFeatures()
  4. layer.startEditing()
  5. for pipe in all_features:
  6.  
  7. if pipe['name'] == '1212_1211':
  8. print('found it ********n ')
  9. pipe_id = pipe.id()
  10.  
  11. geom = pipe.geometry()
  12. print(geom)
  13. new_feat = QgsFeature()
  14. geom = pipe.geometry().asPolyline()
  15. start_point = QgsPoint(geom[0])
  16. end_point = QgsPoint(geom[-1])
  17. print (start_point)
  18. print (start_point.x())
  19.  
  20. <qgis._core.QgsVectorLayer object at 0x000001767C312EE8>
  21. found it ********
  22.  
  23. <QgsGeometry: LineStringZ (26138560.91000000014901161 643574.7099999999627471 778.20000000000004547, 26138558.94000000134110451 643563.81000000005587935 0)>
  24. <QgsPoint: Point (26138560.91000000014901161 643574.7099999999627471)>
Add Comment
Please, Sign In to add comment