I have 2 tables in my database (table1_lines has a lines geometry) and (table_2_points has a points geometry).. I’m doing a buffer of one selected line and I’m trying to get the points which are inside this buffer.. The result is a tables with 2 field of geometry (points and line).. it is important to me to have only the selected points as a result because I use this result in the Mapfile (mapserver).. Is-it possible to do that? Thanks
Asked
Active
Viewed 163 times
1
-
1`select pt.* from points pt, lines ln where st_dwithin(pt, ln, 100) and ln.id = 1;` Where obviously you would replace 100 and 1 by your actual buffer distance and line id. ST_DWithin is better than buffer, as it used an index more effectively. – John Powell Feb 19 '15 at 06:02