[postgis-users] match line with road segment

Stephen Woodbridge woodbri at swoodbridge.com
Wed Jul 16 08:24:25 PDT 2008

searchelite wrote:
> hi all..
> i have a line table consists of gps points, i'm using
> ST_makeline(gps_points) to create the line..my question is, how to match the
> gps line into road segment in postgis? 
> thank you

You can buffer the line and see which segments fall inside the buffer.

select * from roads
  where ST_Contains(the_geom, ST_makeline(gps_points));


More information about the postgis-users mailing list