[pgrouting-users] TSP and how to contribute

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find any tutorial or documentation on it. Does anyone have a documentation for TSP functions ? I am using Dijkstra with a custom query. Is it possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance network from a point or towards a point. How can I integrate my source to pgRouting ?

Last, does anyone worked on road directions for navigation ?

Thanks in advance,

Emre

Hi all

I don’t if it’s the best way to do this, but I faced the driving direction (and distance) issue by writing a pl/pgsql function in which, with a cursor, I compare every couple of linestring into the routing query result to calculate the directions and calculate the partial and total distance.

2011/1/13 Emre Koc <emrekoch@gmail.com>

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find any tutorial or documentation on it. Does anyone have a documentation for TSP functions ? I am using Dijkstra with a custom query. Is it possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance network from a point or towards a point. How can I integrate my source to pgRouting ?

Last, does anyone worked on road directions for navigation ?

Thanks in advance,

Emre


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Lorenzo Amato
lorenzo.amato@geosdi.org
lorenzotlc@gmail.com
lorenzo.amato@nsdi.it

Consiglio Nazionale delle Ricerche
Istituto di Metodologie per l’Analisi Ambientale - geoSDI

2011/1/13 Emre Koc <emrekoch@gmail.com>

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find any tutorial or documentation on it. Does anyone have a documentation for TSP functions ? I am using Dijkstra with a custom query. Is it possible to use TSP with custom query?

This is the documentation: http://www.pgrouting.org/docs/1.x/tsp.html
If you look into the TSP wrapper SQL file, you will find some custom function.
Unfortunately there is not more official documentation yet. If someone knows of some or wants to write some, very welcome!

Also I want to extend pgRouting functionality by calculating a distance network from a point or towards a point. How can I integrate my source to pgRouting ?

To make this easier we moved to Github.
Create your own account at Github, make a fork of the pgRouting repository and when you made some changes that you would like to contribute back to pgRouting, let us know and we can take a look and merge the changes into the main repository. http://www.pgrouting.org/development.html

Last, does anyone worked on road directions for navigation ?

Stephen Woodbridge did as far as I remember, but it depends very much on the available attributes of the road network data you’re using.

Daniel

Thanks in advance,

Emre


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

On Thu, Jan 13, 2011 at 10:52 AM, Daniel Kastl <daniel@georepublic.de> wrote:

2011/1/13 Emre Koc <emrekoch@gmail.com>

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find any tutorial or documentation on it. Does anyone have a documentation for TSP functions ? I am using Dijkstra with a custom query. Is it possible to use TSP with custom query?

This is the documentation: http://www.pgrouting.org/docs/1.x/tsp.html
If you look into the TSP wrapper SQL file, you will find some custom function.
Unfortunately there is not more official documentation yet. If someone knows of some or wants to write some, very welcome!

When I check the tsp wrappers there are functions for tsp_astar, tsp_dijkstra, tsp_ids etc. It would be very nice to have documentation for those but it is very hard to understand the usage by looking at function definitions. But i will have a look at the source and see if I can contribute to documentation.

Also I want to extend pgRouting functionality by calculating a distance network from a point or towards a point. How can I integrate my source to pgRouting ?

To make this easier we moved to Github.
Create your own account at Github, make a fork of the pgRouting repository and when you made some changes that you would like to contribute back to pgRouting, let us know and we can take a look and merge the changes into the main repository. http://www.pgrouting.org/development.html

I will fork and see what I can add to source.

Last, does anyone worked on road directions for navigation ?

Stephen Woodbridge did as far as I remember, but it depends very much on the available attributes of the road network data you’re using.

I have all types of attributes for roads. Is Stephen contributed the source to pgRouting ? I did not see any documentation on directions.

Daniel

Thanks in advance,

Emre


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

On 1/13/2011 3:18 AM, Emre Koc wrote:

Hello,

I am intereted in using TSP functions of pgRouting but I couldn't find
any tutorial or documentation on it. Does anyone have a documentation
for TSP functions ? I am using Dijkstra with a custom query. Is it
possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance
network from a point or towards a point. How can I integrate my source
to pgRouting ?

Last, does anyone worked on road directions for navigation ?

I have built an application that does driving directions but it is very dependent on the underlying data. It is probably possible to abstract it even more than I did to work with any data that meets some minimal requirements. I could of cool things I did was to create templates so it was easy to render the directions in any language that you created a template for. I had templates for ENG, FRE, ESP, and ARB for example.

I also explained the process in a series of posts to the list:
   http://www.google.com/#q=pgrouting driving directions
which you should be able to find using the link above.

Hope this helps. If you have specific questions please ask.

-Steve

Thanks in advance,

Emre

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

On 1/13/2011 3:18 AM, Emre Koc wrote:

Hello,

I am intereted in using TSP functions of pgRouting but I couldn't find
any tutorial or documentation on it. Does anyone have a documentation
for TSP functions ? I am using Dijkstra with a custom query. Is it
possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance
network from a point or towards a point. How can I integrate my source
to pgRouting ?

Yes, I asked for this functionality also. I did a little research into how to do this. I seems that in boost you need to reverse the graph. We already build the graph but would need to then add a step to reverse it to change the sense of direction. I think this is the function that is needed:
http://www.systomath.com/include/Boost-1_35/libs/graph/doc/reverse_graph.html

I'm not sure that we build a bidirectional graph or not. I think we build a directed graph so we can apply different weights on edges for oneway streets.

Anton: Do you know?

-Steve

Last, does anyone worked on road directions for navigation ?

Thanks in advance,

Emre

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

/emre

On Thu, Jan 13, 2011 at 5:10 PM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 1/13/2011 3:18 AM, Emre Koc wrote:

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find
any tutorial or documentation on it. Does anyone have a documentation
for TSP functions ? I am using Dijkstra with a custom query. Is it
possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance
network from a point or towards a point. How can I integrate my source
to pgRouting ?

Yes, I asked for this functionality also. I did a little research into how to do this. I seems that in boost you need to reverse the graph. We already build the graph but would need to then add a step to reverse it to change the sense of direction. I think this is the function that is needed:
http://www.systomath.com/include/Boost-1_35/libs/graph/doc/reverse_graph.html

I checked driving directions functionality and seems like the feature that I was looking for. But It returns non connected edges which are close by a cost. Do you know how does this function really work ? Here is my screenshot http://db.tt/0bb62XB. Shouldn’t the output be connected ?

I’m not sure that we build a bidirectional graph or not. I think we build a directed graph so we can apply different weights on edges for oneway streets.

Anton: Do you know?

-Steve

Last, does anyone worked on road directions for navigation ?

Thanks in advance,

Emre


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi all,
here you can see the routing test with Driving directions I made, writing a pl/psql function and using pgrouting+php+geoext

http://routing.geosdi.org

It uses OSM data of an area rounding the city of Rome.

2011/1/13 Emre Koc <emrekoch@gmail.com>

/emre

On Thu, Jan 13, 2011 at 5:10 PM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 1/13/2011 3:18 AM, Emre Koc wrote:

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find
any tutorial or documentation on it. Does anyone have a documentation
for TSP functions ? I am using Dijkstra with a custom query. Is it
possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance
network from a point or towards a point. How can I integrate my source
to pgRouting ?

Yes, I asked for this functionality also. I did a little research into how to do this. I seems that in boost you need to reverse the graph. We already build the graph but would need to then add a step to reverse it to change the sense of direction. I think this is the function that is needed:
http://www.systomath.com/include/Boost-1_35/libs/graph/doc/reverse_graph.html

I checked driving directions functionality and seems like the feature that I was looking for. But It returns non connected edges which are close by a cost. Do you know how does this function really work ? Here is my screenshot http://db.tt/0bb62XB. Shouldn’t the output be connected ?

I’m not sure that we build a bidirectional graph or not. I think we build a directed graph so we can apply different weights on edges for oneway streets.

Anton: Do you know?

-Steve

Last, does anyone worked on road directions for navigation ?

Thanks in advance,

Emre


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Lorenzo Amato
lorenzo.amato@geosdi.org
lorenzotlc@gmail.com
lorenzo.amato@nsdi.it

Consiglio Nazionale delle Ricerche
Istituto di Metodologie per l’Analisi Ambientale - geoSDI

2011/1/14 Stephen Woodbridge <woodbri@swoodbridge.com>

On 1/13/2011 3:18 AM, Emre Koc wrote:

Hello,

I am intereted in using TSP functions of pgRouting but I couldn’t find
any tutorial or documentation on it. Does anyone have a documentation
for TSP functions ? I am using Dijkstra with a custom query. Is it
possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a distance
network from a point or towards a point. How can I integrate my source
to pgRouting ?

Yes, I asked for this functionality also. I did a little research into how to do this. I seems that in boost you need to reverse the graph. We already build the graph but would need to then add a step to reverse it to change the sense of direction. I think this is the function that is needed:
http://www.systomath.com/include/Boost-1_35/libs/graph/doc/reverse_graph.html

Maybe someone wants to add an RFC for that (http://www.pgrouting.org/rfc/index.html).
Soon there will be GSoC and students will be looking for project ideas.

Recently “SRC” (don’t know the real name) wrote some bidirectional patch for pgRouting. I applied the patch to my fork at GitHub called “Two-Way A-Star”: https://github.com/dkastl/pgrouting
Is this somehow related?

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

2011/1/14 lorenzo amato <lorenzo.amato@geosdi.org>

Hi all,
here you can see the routing test with Driving directions I made, writing a pl/psql function and using pgrouting+php+geoext

http://routing.geosdi.org

It uses OSM data of an area rounding the city of Rome.

Hi Lorenzo,

May I add this demo to the gallery page?
http://www.pgrouting.org/gallery.html

It would be nice to have some sample pl/psql functions available for pgRouting users, so they can learn from examples and share them with the community. Would you like to share yours with others?
For this purpose I created this GitHub repository: https://github.com/pgRouting/pgrouting-contrib
Anyone interested in adding some code samples there can get write access … just send me an email with your GitHub account name.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

I checked driving directions functionality and seems like the feature that I was looking for. But It returns non connected edges which are close by a cost. Do you know how does this function really work ? Here is my screenshot http://db.tt/0bb62XB. Shouldn’t the output be connected ?

Could you tell us what you did exactly? The query for example.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

On 1/13/2011 10:15 PM, Daniel Kastl wrote:

2011/1/14 Stephen Woodbridge <woodbri@swoodbridge.com
<mailto:woodbri@swoodbridge.com>>

    On 1/13/2011 3:18 AM, Emre Koc wrote:

        Hello,

        I am intereted in using TSP functions of pgRouting but I
        couldn't find
        any tutorial or documentation on it. Does anyone have a
        documentation
        for TSP functions ? I am using Dijkstra with a custom query. Is it
        possible to use TSP with custom query?

        Also I want to extend pgRouting functionality by calculating a
        distance
        network from a point or towards a point. How can I integrate my
        source
        to pgRouting ?

    Yes, I asked for this functionality also. I did a little research
    into how to do this. I seems that in boost you need to reverse the
    graph. We already build the graph but would need to then add a step
    to reverse it to change the sense of direction. I think this is the
    function that is needed:
    http://www.systomath.com/include/Boost-1_35/libs/graph/doc/reverse_graph.html

Maybe someone wants to add an RFC for that
(http://www.pgrouting.org/rfc/index.html).
Soon there will be GSoC and students will be looking for project ideas.

Recently "SRC" (don't know the real name) wrote some bidirectional patch
for pgRouting. I applied the patch to my fork at GitHub called "Two-Way
A-Star": https://github.com/dkastl/pgrouting
Is this somehow related?

Daniel,

This might apply to this problem, but I have not looked at what he did or how it is implemented. On an undirected graph routing from A->B is the same as B->A, on a directed graph this does not have to be the case.

For bi-directional routing on a directed graph, you need to reverse the graph or otherwise trick the algorithm when it is routing FROM the destination toward the start. At the destination you need to ask what node could I have come FROM to get here, but at the start you have to ask what nodes can I go TO from here. So you need a graph and a reverse graph or you need to maintain enough a list of outgoing nodes AND a separate list of incoming nodes.

For drive time analysis, you might want to compute what is the area covered by consumers that are willing to drive 20 min to get to my store located "here". So "here" is the destination. But if you are a municipal planner, you might want to know what coverage area do my fire-stations have with a drive time of 5 mins or 10 mins. In this case the fire-station is the start point.

For undirected graphs, there is no difference.

-Steve

Sure

Here is my sql query for that image.

SELECT edges.gid, ST_AsText(edges.the_geom) AS geotext,
edges.ft_minutes,
edges.meters
FROM edges,
(SELECT edge_id, cost FROM driving_distance(‘SELECT gid as id,
source::integer,
target::integer,
meters::double precision as cost
FROM edges’, $startVertexID, $cost,false,false)
) as rt
WHERE edges.gid=rt.edge_id;";

I just give a sample vertex id and a cost value in meters and got resulting edges. Normally when I find shortest paths all roads are connected so the graph is ok. But this driving directions does not output connected roads, thats the thing I do not understand.

/emre

On Fri, Jan 14, 2011 at 5:26 AM, Daniel Kastl <daniel@georepublic.de> wrote:

I checked driving directions functionality and seems like the feature that I was looking for. But It returns non connected edges which are close by a cost. Do you know how does this function really work ? Here is my screenshot http://db.tt/0bb62XB. Shouldn’t the output be connected ?

Could you tell us what you did exactly? The query for example.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Hi Daniel

2011/1/14 Daniel Kastl <daniel@georepublic.de>

2011/1/14 lorenzo amato <lorenzo.amato@geosdi.org>

Hi all,
here you can see the routing test with Driving directions I made, writing a pl/psql function and using pgrouting+php+geoext

http://routing.geosdi.org

It uses OSM data of an area rounding the city of Rome.

Hi Lorenzo,

May I add this demo to the gallery page?
http://www.pgrouting.org/gallery.html

Of course, it would be great!

It would be nice to have some sample pl/psql functions available for pgRouting users, so they can learn from examples and share them with the community. Would you like to share yours with others?
For this purpose I created this GitHub repository: https://github.com/pgRouting/pgrouting-contrib
Anyone interested in adding some code samples there can get write access … just send me an email with your GitHub account name.

Yes, as soon as possible!

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Lorenzo Amato
lorenzo.amato@geosdi.org
lorenzotlc@gmail.com
lorenzo.amato@nsdi.it

Consiglio Nazionale delle Ricerche
Istituto di Metodologie per l’Analisi Ambientale - geoSDI

Steve,

To trick the algorithm can’t we switch reverse_cost and cost values in driving directions ? I think that if driving directions can output a connected road network that will both cover your 5 min roads to store and fire-station reachability. Am I wrong about this ?

/emre

On Fri, Jan 14, 2011 at 8:01 AM, Stephen Woodbridge <woodbri@swoodbridge.com> wrote:

On 1/13/2011 10:15 PM, Daniel Kastl wrote:

2011/1/14 Stephen Woodbridge <woodbri@swoodbridge.com

mailto:[woodbri@swoodbridge.com](mailto:woodbri@swoodbridge.com)>

On 1/13/2011 3:18 AM, Emre Koc wrote:

Hello,

I am intereted in using TSP functions of pgRouting but I
couldn’t find
any tutorial or documentation on it. Does anyone have a
documentation
for TSP functions ? I am using Dijkstra with a custom query. Is it
possible to use TSP with custom query?

Also I want to extend pgRouting functionality by calculating a
distance
network from a point or towards a point. How can I integrate my
source
to pgRouting ?

Yes, I asked for this functionality also. I did a little research
into how to do this. I seems that in boost you need to reverse the
graph. We already build the graph but would need to then add a step
to reverse it to change the sense of direction. I think this is the
function that is needed:
http://www.systomath.com/include/Boost-1_35/libs/graph/doc/reverse_graph.html

Maybe someone wants to add an RFC for that
(http://www.pgrouting.org/rfc/index.html).
Soon there will be GSoC and students will be looking for project ideas.

Recently “SRC” (don’t know the real name) wrote some bidirectional patch
for pgRouting. I applied the patch to my fork at GitHub called “Two-Way
A-Star”: https://github.com/dkastl/pgrouting
Is this somehow related?

Daniel,

This might apply to this problem, but I have not looked at what he did or how it is implemented. On an undirected graph routing from A->B is the same as B->A, on a directed graph this does not have to be the case.

For bi-directional routing on a directed graph, you need to reverse the graph or otherwise trick the algorithm when it is routing FROM the destination toward the start. At the destination you need to ask what node could I have come FROM to get here, but at the start you have to ask what nodes can I go TO from here. So you need a graph and a reverse graph or you need to maintain enough a list of outgoing nodes AND a separate list of incoming nodes.

For drive time analysis, you might want to compute what is the area covered by consumers that are willing to drive 20 min to get to my store located “here”. So “here” is the destination. But if you are a municipal planner, you might want to know what coverage area do my fire-stations have with a drive time of 5 mins or 10 mins. In this case the fire-station is the start point.

For undirected graphs, there is no difference.

-Steve


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

2011/1/14 Emre Koc <emrekoch@gmail.com>

Sure

Here is my sql query for that image.

SELECT edges.gid, ST_AsText(edges.the_geom) AS geotext,
edges.ft_minutes,
edges.meters
FROM edges,
(SELECT edge_id, cost FROM driving_distance(‘SELECT gid as id,
source::integer,
target::integer,
meters::double precision as cost
FROM edges’, $startVertexID, $cost,false,false)
) as rt
WHERE edges.gid=rt.edge_id;";

I just give a sample vertex id and a cost value in meters and got resulting edges. Normally when I find shortest paths all roads are connected so the graph is ok. But this driving directions does not output connected roads, thats the thing I do not understand.

Driving distance returns you all the vertices you can reach from a start point to within what you have defined as the maximum costs.
I think you’re looking for another query (Dijkstra, A-Star, Shooting Star).

The edge column in driving distance doesn’t return a “useful” result as I just answered the day before in this message:
http://lists.osgeo.org/pipermail/pgrouting-users/2011-January/000474.html

Daniel

/emre

On Fri, Jan 14, 2011 at 5:26 AM, Daniel Kastl <daniel@georepublic.de> wrote:

I checked driving directions functionality and seems like the feature that I was looking for. But It returns non connected edges which are close by a cost. Do you know how does this function really work ? Here is my screenshot http://db.tt/0bb62XB. Shouldn’t the output be connected ?

Could you tell us what you did exactly? The query for example.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

/emre

On Fri, Jan 14, 2011 at 10:15 AM, Daniel Kastl <daniel@georepublic.de> wrote:

2011/1/14 Emre Koc <emrekoch@gmail.com>

Sure

Here is my sql query for that image.

SELECT edges.gid, ST_AsText(edges.the_geom) AS geotext,
edges.ft_minutes,
edges.meters
FROM edges,
(SELECT edge_id, cost FROM driving_distance(‘SELECT gid as id,
source::integer,
target::integer,
meters::double precision as cost
FROM edges’, $startVertexID, $cost,false,false)
) as rt
WHERE edges.gid=rt.edge_id;";

I just give a sample vertex id and a cost value in meters and got resulting edges. Normally when I find shortest paths all roads are connected so the graph is ok. But this driving directions does not output connected roads, thats the thing I do not understand.

Driving distance returns you all the vertices you can reach from a start point to within what you have defined as the maximum costs.
I think you’re looking for another query (Dijkstra, A-Star, Shooting Star).

I am looking for a output that shows road network that I can reach from a start point within a defined maximum cost. So if driving distance does not output connected edges what do you suggest me to do in order to have a connected road network with the given vertices ? Running shortest path for each vertex does not seem feasible but I am unable to see a way to implement it without going inside c functions.

The edge column in driving distance doesn’t return a “useful” result as I just answered the day before in this message:
http://lists.osgeo.org/pipermail/pgrouting-users/2011-January/000474.html

Daniel

/emre

On Fri, Jan 14, 2011 at 5:26 AM, Daniel Kastl <daniel@georepublic.de> wrote:

I checked driving directions functionality and seems like the feature that I was looking for. But It returns non connected edges which are close by a cost. Do you know how does this function really work ? Here is my screenshot http://db.tt/0bb62XB. Shouldn’t the output be connected ?

Could you tell us what you did exactly? The query for example.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

2011/1/14 Emre Koc <emrekoch@gmail.com>

/emre

On Fri, Jan 14, 2011 at 10:15 AM, Daniel Kastl <daniel@georepublic.de> wrote:

2011/1/14 Emre Koc <emrekoch@gmail.com>

Sure

Here is my sql query for that image.

SELECT edges.gid, ST_AsText(edges.the_geom) AS geotext,
edges.ft_minutes,
edges.meters
FROM edges,
(SELECT edge_id, cost FROM driving_distance(‘SELECT gid as id,
source::integer,
target::integer,
meters::double precision as cost
FROM edges’, $startVertexID, $cost,false,false)
) as rt
WHERE edges.gid=rt.edge_id;";

I just give a sample vertex id and a cost value in meters and got resulting edges. Normally when I find shortest paths all roads are connected so the graph is ok. But this driving directions does not output connected roads, thats the thing I do not understand.

Driving distance returns you all the vertices you can reach from a start point to within what you have defined as the maximum costs.
I think you’re looking for another query (Dijkstra, A-Star, Shooting Star).

I am looking for a output that shows road network that I can reach from a start point within a defined maximum cost. So if driving distance does not output connected edges what do you suggest me to do in order to have a connected road network with the given vertices ? Running shortest path for each vertex does not seem feasible but I am unable to see a way to implement it without going inside c functions.

Sorry, I was wrong … it’s the right function you’re using. Somehow read driving directions somewhere before.
Driving directions does what you need, except that it returns you a list of vertices you can reach and the edges column doesn’t return anything useful.

This custom wrapper function takes the vertices and calculates a polygon that contains all of them:
https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/sql/routing_dd_wrappers.sql#L78

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de

/emre

On Fri, Jan 14, 2011 at 10:36 AM, Daniel Kastl <daniel@georepublic.de> wrote:

2011/1/14 Emre Koc <emrekoch@gmail.com>

/emre

On Fri, Jan 14, 2011 at 10:15 AM, Daniel Kastl <daniel@georepublic.de> wrote:

2011/1/14 Emre Koc <emrekoch@gmail.com>

Sure

Here is my sql query for that image.

SELECT edges.gid, ST_AsText(edges.the_geom) AS geotext,
edges.ft_minutes,
edges.meters
FROM edges,
(SELECT edge_id, cost FROM driving_distance(‘SELECT gid as id,
source::integer,
target::integer,
meters::double precision as cost
FROM edges’, $startVertexID, $cost,false,false)
) as rt
WHERE edges.gid=rt.edge_id;";

I just give a sample vertex id and a cost value in meters and got resulting edges. Normally when I find shortest paths all roads are connected so the graph is ok. But this driving directions does not output connected roads, thats the thing I do not understand.

Driving distance returns you all the vertices you can reach from a start point to within what you have defined as the maximum costs.
I think you’re looking for another query (Dijkstra, A-Star, Shooting Star).

I am looking for a output that shows road network that I can reach from a start point within a defined maximum cost. So if driving distance does not output connected edges what do you suggest me to do in order to have a connected road network with the given vertices ? Running shortest path for each vertex does not seem feasible but I am unable to see a way to implement it without going inside c functions.

Sorry, I was wrong … it’s the right function you’re using. Somehow read driving directions somewhere before.
Driving directions does what you need, except that it returns you a list of vertices you can reach and the edges column doesn’t return anything useful.

This custom wrapper function takes the vertices and calculates a polygon that contains all of them:
https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/sql/routing_dd_wrappers.sql#L78

Yes this creates a polygon consisting all vertices but I want to display a road network that show how to go from source to outlying vertices. Actually I think driving distance’s edge info should give that info since it calculates a distance from source. If that function know how distant is the vertice it should know the path am I wrong on this ?

As I wrote, calculating shortest path for each vertex from source does not seem feasible. Can we make driving distance to show edge info ? I am willing to conribute in that sense but I don’t want to redo what is done before.

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de


Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

Sorry, I was wrong … it’s the right function you’re using. Somehow read driving directions somewhere before.
Driving directions does what you need, except that it returns you a list of vertices you can reach and the edges column doesn’t return anything useful.

This custom wrapper function takes the vertices and calculates a polygon that contains all of them:
https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/sql/routing_dd_wrappers.sql#L78

Yes this creates a polygon consisting all vertices but I want to display a road network that show how to go from source to outlying vertices. Actually I think driving distance’s edge info should give that info since it calculates a distance from source. If that function know how distant is the vertice it should know the path am I wrong on this ?

As I wrote, calculating shortest path for each vertex from source does not seem feasible. Can we make driving distance to show edge info ? I am willing to conribute in that sense but I don’t want to redo what is done before.

Driving Distance function uses Dijkstra algorithm:
https://github.com/pgRouting/pgrouting/blob/master/extra/driving_distance/src/drivedist.c#L341
Dijkstra only goes from vertex to vertex.

@Anton: do you have some hint?

Daniel


Georepublic UG & Georepublic Japan
eMail: daniel.kastl@georepublic.de
Web: http://georepublic.de