I have a dataset of manholes and pipes; I want to snap the lines start and end nodes to the manholes if they are within a specified distance. Been trying to find away to do this using PostGIS or QGIS because I don't have access to the Arc Desktop tools to do it. I found a post of a similar situation but I cannot get the function to work, I don't know what information is suppose to go where in the expression.
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
I thought it was suppose to work like this;
SELECT f.id as gid, ST_Snap(f.geom, g.geom, 2) as geom FROM smains as f, (SELECT ST_Collect(geom) as Geometry FROM samh) as g
I get column g.geom does not exist, but the column samh.geom does and to my understanding g = samh. When I change it to samh.geom I get missing FROM-clause entry for table "samh" which sounds to me that the variable samh is not defined, but it isn't a variable it is a table.