[pgrouting-users] driving distance for multiple nodes

Hi Geoff,

I am also new to this, but have been experimenting with the same sort of
problem.

My workings and particularly the "my_get_network_catchment.sql" function
which I have uploaded to https://github.com/alaw005/pgrouting_functions
might be helpful. The solution was to use a loop within a postgis function.

Regards
Adam

Date: Fri, 29 Aug 2014 10:41:19 -0400
From: "Dougherty, Geoff" <geoffdougherty@gmail.com>
To: pgrouting-users@lists.osgeo.org
Subject: [pgrouting-users] driving distance for multiple nodes
Message-ID: <705E7660-B5D6-4848-BD8A-30692DBBEBCF@gmail.com>
Content-Type: text/plain; charset="windows-1252"

Hi, all.

I?m new to postGis/pgRouting, and am trying to find driving distances to
all nodes within a certain distance of a set of starting points/nodes.

I have some code (thanks to
http://anitagraser.com/2011/05/13/catchment-areas-with-pgrouting-driving_distance/)
that seems to work for a single point:

SELECT seq, id1 AS node, cost
        FROM pgr_drivingDistance(
                'SELECT gid as id, source, target, length::float8 AS cost
FROM roads',
                7, 100000, false, false
        );

However, I have a separate table containing a few hundred points (with
lat, lon and geom) for which I need to identify driving distance to other
points. Do I need to consider adding some additional join, or perhaps some
python code to loop through the other table?

Hi, Adam. This is really helpful.

One quick question: I’m noticing that all of the values for the catchment field in the results table are set to the same value selected by me as the input catchment distance.

i.e. in your example below, all of the resulting catchment distances would be 400:

Usage:
SELECT *
INTO hutt_pax.tmp_stop_catchment
FROM my_get_network_catchment(
‘SELECT
stop_id::integer AS id,
the_geom::geometry AS the_geom
FROM gtfs_stops
WHERE stop_id IN(’‘10446’‘,’‘10415’‘,’‘10427’‘)’,
‘hutt_pax.wainuiomata_roads_20m’,
400,
2193,
‘distance’
);

Any thoughts on why this might occur?

···

Hi Geoff,

I am also new to this, but have been experimenting with the same sort of problem.

My workings and particularly the “my_get_network_catchment.sql” function which I have uploaded to https://github.com/alaw005/pgrouting_functions might be helpful. The solution was to use a loop within a postgis function.

Regards
Adam

Date: Fri, 29 Aug 2014 10:41:19 -0400
From: “Dougherty, Geoff” <geoffdougherty@gmail.com>
To: pgrouting-users@lists.osgeo.org
Subject: [pgrouting-users] driving distance for multiple nodes
Message-ID: <705E7660-B5D6-4848-BD8A-30692DBBEBCF@gmail.com>
Content-Type: text/plain; charset=“windows-1252”

Hi, all.

I?m new to postGis/pgRouting, and am trying to find driving distances to all nodes within a certain distance of a set of starting points/nodes.

I have some code (thanks to http://anitagraser.com/2011/05/13/catchment-areas-with-pgrouting-driving_distance/) that seems to work for a single point:

SELECT seq, id1 AS node, cost
FROM pgr_drivingDistance(
‘SELECT gid as id, source, target, length::float8 AS cost FROM roads’,
7, 100000, false, false
);

However, I have a separate table containing a few hundred points (with lat, lon and geom) for which I need to identify driving distance to other points. Do I need to consider adding some additional join, or perhaps some python code to loop through the other table?