Hi, Nicolas, Thanks.
That is very interesting. I will test it. I could not find information on how distance is defined. 0.01 stands on what unit? https://postgis.net/docs/ST_DWithin.html Regards, Shao On Fri, 15 May 2020 at 11:32, Nicolas Ribot <[email protected]> wrote: > Hi, > > You can test for proximity between start and end points > Create spatial indexes on st_startpoint(geom) and st_endpoint(geom) on > your line features table (also index starting and ending points column in > table one) > > select t.id, r.id, r.geom > from start_end_table t join roads r on st_dwithin(t.startpoint, > st_startpoint(r.geom), 0.01) and st_dwithin(t.endpoint, > st_endpoint(r.geom), 0.01) > > Adjust the 0.01 distance according to your data and their precision. > > Nicolas > > On Fri, 15 May 2020 at 11:42, Shaozhong SHI <[email protected]> > wrote: > >> Given 2 tables. One has the starting and ending points of roads, and the >> other has line features. How best to do spatial linking or selection of >> road features? >> >> Can anyone enlighten me? >> >> Regards, >> >> Shao >> _______________________________________________ >> postgis-users mailing list >> [email protected] >> https://lists.osgeo.org/mailman/listinfo/postgis-users > > _______________________________________________ > postgis-users mailing list > [email protected] > https://lists.osgeo.org/mailman/listinfo/postgis-users
_______________________________________________ postgis-users mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/postgis-users
