I have a lines layer (roads) and a points layer (accidents). I'm projecting the points on the lines with st_closestpoint so that I'm sure the accidents are located on the closest road line. I now want to associate the points to the lines based on their (overlapping) position. I do not want to use a buffer. The problem is that after I projected the points on the lines I, weirdly, cannot associate the resulting points (now located on the lines) with the lines themselves. I tried with st_intersect and st_crosses but with no success, as if the points and lines aren't actually sharing any coordinate.
What am I doing wrong?
How else could I classify the lines based on the number of points located on them?