My problem is that I have lines that I want to lengthen and tied them to a point
And in case that I have two line one in continuous and the other is cutted I want only the cutted one to be tied( attached or snaped) to the point and the other to stay at its place.
I've tried this code but in the result the two lines has snapped to the point.
SELECT f.gid as gid,
ST_Snap(f.Geom, g.Geom, 2) as geom
FROM cablen as f,
(SELECT ST_Collect(Geom) as Geom FROM boiten) as g
In the last case the line has snapped to the point and become tow so like you see i have three line and in the result i found four ones but I want them to be like this
Update
after editing my code to this ,i Found the result geom Null
SELECT f.gid AS gid,
ST_Snap(
ST_StartPoint(f.geom),
ST_ClosestPoint(g.Geom, ST_StartPoint(f.geom) ),
ST_Distance(
ST_StartPoint(f.geom) ,
ST_ClosestPoint(g.Geom, ST_StartPoint(f.geom) )
) * 1.2
) AS geom
FROM (
SELECT ST_Collect(Geom) as Geom
FROM bt_sout
) AS g,
cablen AS f