[OSGeo Africa] Travel Time Calculation

Gavin Fleming gavinjfleming at gmail.com
Tue Jan 15 13:04:41 PST 2013


Hi Uazu

Yes I still recommend pgRouting

There are two problems here:

1) calculating the travel times along the road network. With pgRouting 
you can do that with dijkstra, A-star or shooting star. And if your 
network is directed or has turn restrictions you can use those too.

2) figuring out which urban centre is closest (in travel time, not 
distance) to each village along the road network rather than as the crow 
flies.

A brute force yet simple way to solve both problems in one go would be 
to calculate travel time between all pairs of villages and urban 
centres, then just rank your answers and choose the shortest travel time 
with its corresponding urban centre for each village.

You could do the same in GRASS with the v.net family of functions 
(http://grass.osgeo.org/grass64/manuals/v.net.html) and some bash or 
Python scripting. v.net.allpairs would probably come in handy amongst 
others.

Gavin

On 15/01/2013 15:06, Uazukuani wrote:
> Hi Gavin
>
> I am under strict instructions to calculate along the road network. It 
> is for the Census of Agriculture. I have to calculate the travel time 
> from each village to the nearest urban center "by motorable road" to 
> have a feel of how long (far) farmers have to travel to get 
> fertilizers, pesticides, seeds etc.
>
> */It is possible to calculate the closest along the network but that 
> is a bit more complicated and straight line distance might be good 
> enough./*
>
> I noted that pgRouting is well documented and will definitely give it 
> a try, but since I have to calculate along the road network and have 
> no prior experience of pgRouting, are you still recommending it?
>
> rgds,
> Uazu
>
>
> On Mon, Jan 14, 2013 at 8:07 PM, Gavin Fleming 
> <gavin at afrispatial.co.za <mailto:gavin at afrispatial.co.za>> wrote:
>
>     Hi Uazu
>
>     I would use pgRouting (http://pgrouting.org/)
>
>     - install pgRouting
>     - add pgRouting to a PostGIS database
>     - load your roads and points into the database
>     - set up network topology by adding nodes with the
>     assign_vertex_id() function. Check that you have a properly
>     connected network.
>     - you can use any value as cost. In this case you'd want to
>     calculate the cost field (pgRouting uses 'length' be default) as
>     travel time. You could use road length with other information like
>     speed limits to calculate or estimate travel time per road segment.
>     - Set up lists or tables of your villages and urban centres
>     - Use PostGIS functions to calculate the closest urban centre to
>     each village (as the crow flies). It is possible to calculate the
>     closest along the network but that is a bit more complicated and
>     straight line distance might be good enough.
>     - Then use pgRouting to calculate the shortest path between each
>     of your chosen pairs and return travel time.
>
>     To automate this I would write a Python script.
>
>     There is good documentation and workshops on the pgRouting site
>     and elsewhere.
>
>     hth
>
>     Gavin
>
>
>     On 14/01/2013 16:20, Uazukuani wrote:
>
>         Dear All
>
>
>         I have a problem that I hope someone on this mailing list
>         could assist with.
>
>         I want to calculate travel time from (each) VILLAGE to the
>         nearest URBAN CENTER along the road network*.*
>
>
>         The output format could be text or GIS with at least 3
>         columns: 1. Village, 2. Nearest Urban Centre and 3. Travel Time.
>
>
>         I have 3 data sets: 1. Villages (Point), 2. Urban centers
>         (Point) & 3. Roads (Polyline/line) for the whole country
>         (Namibia).
>
>
>         I would appreciate if someone refers me to tutorials on this.
>
>         I have access to PostGIS, QGIS and GvSIG, ArcInfo, GeoMedia
>         Pro 6.x, MS SQL Server 2008 (Spatial) but am willing to try
>         something else.
>
>
>         Rgds,
>
>         Uazu
>
>
>
>
>         _______________________________________________
>         Africa mailing list
>         Africa at lists.osgeo.org <mailto:Africa at lists.osgeo.org>
>         http://lists.osgeo.org/mailman/listinfo/africa
>
>
>
>     -- 
>     regards
>
>     Gavin
>
>     Gavin Fleming
>     http://afrispatial.co.za
>     t: 0218620670
>     c: 0845965680
>     f: 0866164820
>
>     _______________________________________________
>     Africa mailing list
>     Africa at lists.osgeo.org <mailto:Africa at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/africa
>
>
>
>
> _______________________________________________
> Africa mailing list
> Africa at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/africa


-- 
Gavin Fleming
t: 0218620670
w: 0218630660
c: 0845965680
f: 0866164820
Paarl
South Africa
18°59'19.6"E 33°44'46.1"S



More information about the Africa mailing list