[postgis-users] match line with road segment
Stephen Woodbridge
woodbri at swoodbridge.com
Fri Jul 18 08:23:55 PDT 2008
searchelite wrote:
>
> Stephen Woodbridge wrote:
>> 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));
Sorry, this should have been:
select * from roads
where ST_Contains(the_geom, Buffer(ST_makeline(gps_points)), "value");
where "value" is the radius of the sausage that you are going to make
the line into. This has to be in the units of you data set, which is
likely degrees. 69 mile ~= 1 degree, 69*5280 ft ~= 1 degree so 50 ft ~=
50/(69*5280) = 0.00013724 so try that for starters and adjust it as
required to get good results.
-Steve
>> -Steve
>>
>
> thank you for the reply..can you be more detail please..i've tried your
> suggestion but it returned no record.
>
> I create a simple illustration below.. the green line is the record from
> road table, and the red line is the route table generated from
> ST_Makeline(gps_points), I want to make the red line snap into the road so
> it become the route
>
> http://www.nabble.com/file/p18504794/untitled.jpg
>
> Thank you in advance
>
More information about the postgis-users
mailing list