[pgrouting-users] Working with Driving Distance
Roger André
randre at gmail.com
Tue Dec 21 22:55:31 EST 2010
Hi Daniel,
Thanks for your reply. I checked, and it appears that I have that wrapper
function installed. Here is what my pgrouting install dir looks like:
$ pwd
/usr/local/pgrouting-1.05/extra/driving_distance/sql
$ ll
total 36
drwxr-xr-x 3 15036 users 4096 2010-12-21 15:58 ./
drwxr-xr-x 5 15036 users 4096 2010-12-21 15:58 ../
drwxr-xr-x 2 root root 4096 2010-12-21 15:58 CMakeFiles/
-rw-r--r-- 1 root root 1811 2010-12-21 15:58 cmake_install.cmake
-rw-r--r-- 1 15036 users 134 2010-11-16 18:42 CMakeLists.txt
-rw-r--r-- 1 root root 5540 2010-12-21 15:58 Makefile
-rw-r--r-- 1 15036 users 1757 2010-11-16 18:42 routing_dd.sql
-rw-r--r-- 1 15036 users 3790 2010-11-16 18:42 routing_dd_wrappers.sql
And I did make sure to run both SQL files against the database my roads are
stored in.
482 psql -d eligibility -f routing_dd.sql
483 psql -d eligibility -f routing_dd_wrappers.sql
490 psql -d eligibility -f routing_tsp.sql
491 psql -d eligibility -f routing_tsp_wrappers.sql
I will review your usage instructions and see if I'm missing anything.
Roger
--
On Tue, Dec 21, 2010 at 5:51 PM, Daniel Kastl <daniel at georepublic.de> wrote:
> Hi Roger,
>
> You're using the "core" function, I think.
> You could use the driving_distance wrapper function, which will return you
> a polyogon.
> For that you need to load this SQL:
> https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/sql/routing_dd_wrappers.sql
> You can also find it in the directory where the other pgRouting SQL files
> are.
>
> The function will take these parameters then:
>
> driving_distance(table_name varchar, x double precision, y double
> precision,
> distance double precision, cost varchar, reverse_cost varchar,
> directed boolean, has_reverse_cost boolean)
>
> X,Y are the coordinates you take as a center point.
> You can take the returned polygon then and do other spatial queries.
>
> Best regards,
> Daniel
>
>
>
> 2010/12/22 Roger André <randre at gmail.com>
>
>> Hi All,
>>
>> I need to generate some maps that show all of the road segments that are
>> within a certain distance of specific points. I have been able to generate
>> some answers using the driving_distance function, but am not sure what to do
>> with them. Here's what I get:
>>
>> # SELECT * FROM driving_distance('SELECT gid AS id, source, target,
>> length::double precision AS cost FROM edges',49,2000,false,false);
>> vertex_id | edge_id | cost
>> -----------+---------+------------------
>> 15 | 9 | 1854.34547361565
>> 20 | 104 | 1549.85630678904
>> 22 | 68 | 858.367668935802
>> 23 | 125 | 1466.02479201359
>> 24 | 75 | 801.137871846872
>> 25 | 125 | 1169.02817170106
>> 26 | 106 | 1296.98197602289
>> 48 | 71 | 902.595810873304
>> 49 | 106 | 0
>> 51 | 74 | 1948.07551810288
>> 52 | 75 | 1620.93404864578
>> (11 rows)
>>
>> These answers seem legit, but I'm not sure what to do with them.
>> Ultimately, I need to show both the minimum enclosing polygon that
>> "surrounds" all of the road segments, as well as the road segments
>> themselves. Can someone please give me some pointers as to what I can do to
>> accomplish this?
>>
>> Thanks,
>>
>> Roger
>> --
>>
>> _______________________________________________
>> Pgrouting-users mailing list
>> Pgrouting-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>>
>>
>
>
> --
> Georepublic UG & Georepublic Japan
> eMail: daniel.kastl at georepublic.de
> Web: http://georepublic.de
>
> _______________________________________________
> Pgrouting-users mailing list
> Pgrouting-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20101221/8c1493b7/attachment-0001.html
More information about the Pgrouting-users
mailing list