I write a request that allows to snap a point to another. Here is the request:
SELECT
f.gid as gid,
ST_Snap (f.Geom, g.Geom, min, 5) as geom
FROM
boiten as f,
(SELECT ST_Collect (Geom) as Geom
FROM ft_chambre) as g
It works but the snapped points missed the closest position
Update:
For the CRS it's 2154 ,I want to snap the point to the red ones
I modified my code to this:
SELECT
f.gid as gid,
ST_Snap(f.Geom, g.Geom, st_distance(f.Geom, g.Geom)*1.2) as geom
FROM
boiten as f,
(SELECT ST_Collect(Geom) as Geom
FROM ft_chambre) as g
But like you see there are points witch snapped to the wrong place or has snapped to more than one.
For exemple
This point has snapped to the wrong place where the other point has already snapped to
