Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- layer = iface.activeLayer()
- print(layer)
- all_features = layer.getFeatures()
- layer.startEditing()
- for pipe in all_features:
- if pipe['name'] == '1212_1211':
- print('found it ********n ')
- pipe_id = pipe.id()
- geom = pipe.geometry()
- print(geom)
- new_feat = QgsFeature()
- geom = pipe.geometry().asPolyline()
- start_point = QgsPoint(geom[0])
- end_point = QgsPoint(geom[-1])
- print (start_point)
- print (start_point.x())
- <qgis._core.QgsVectorLayer object at 0x000001767C312EE8>
- found it ********
- <QgsGeometry: LineStringZ (26138560.91000000014901161 643574.7099999999627471 778.20000000000004547, 26138558.94000000134110451 643563.81000000005587935 0)>
- <QgsPoint: Point (26138560.91000000014901161 643574.7099999999627471)>
Add Comment
Please, Sign In to add comment