Created a buffer of 0.001 size at the beginning and end of each link. I want to extract the starting point and the ending point of which the number of the buffer and the link intersect is one.

layer = iface.activeLayer() 
for f in layer.getFeatures(): 
  geom = f.geometry().asPolyline() 
  start_point = QgsPoint(geom[0]) 
  end_point = QgsPoint(geom[-1])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.