2

We extracted the start and end points in the link layer.

Can I buffer at the start and end points? (Size 0.001)

layer = iface.activeLayer() 
for f in layer.getFeatures(): 
  geom = f.geometry().asPolyline() 
  start_point = QgsPoint(geom[0]) 
  end_point = QgsPoint(geom[-1]) 
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
OH.hong
  • 61
  • 6
  • 1
    You should be able to construct a QgsGeometry object https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/geometry.html like StartGeom=QgsGeometry.fromPointXY(start_point) then use the buffer method StartBuff = StartGeom.buffer(0.001) https://qgis.org/pyqgis/3.0/core/Geometry/QgsGeometry.html#qgis.core.QgsGeometry.buffer – Michael Stimson Jul 25 '18 at 06:54

0 Answers0