3

I have two vector shapefiles: One file is points representing manholes and the other is a polyline file representing pipes leading to and from the manholes. I need to snap the lines within a specified distance to the closest manhole(centroid of point manhole).

How can i do it in qgis using python. I have found the solution in sqlite or postgis but i want to do it in qgis.

SELECT
    f.gid as gid,
    ST_Snap(f.Geometry, g.Geometry, 2) as geom
FROM
    pipe as f,
    (SELECT ST_Collect(Geometry) as Geometry
     FROM mh) as g
PolyGeo
  • 65,136
  • 29
  • 109
  • 338
user99
  • 39
  • 1

1 Answers1

1

Try using processing toolbox function "Snap geometries to layer" or try using spatial index

nb_tr
  • 11
  • 1