I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Which version of Ubuntu do you use (your screenshots look like Ubuntu, right)?
In general compiling works as described in the documents, but some releases come with new versions of dependencies or cause other troubles.
Also, do you use standard PostgreSQL packages?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
Which version of Ubuntu do you use (your screenshots look like Ubuntu, right)?
In general compiling works as described in the documents, but some releases come with new versions of dependencies or cause other troubles.
Also, do you use standard PostgreSQL packages?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
You’re probably missing the packages to compile, because this isn’t mentioned in the tutorial.
There it installs the packages from the Launchpad repository.
You need to install are the following packages:
build-essential, postgresql-server-dev-9.1, cmake, libboost-graph-dev, gaul-devel and libcgal7 or libcgal8 (I don’t remember the version)
Which version of Ubuntu do you use (your screenshots look like Ubuntu, right)?
In general compiling works as described in the documents, but some releases come with new versions of dependencies or cause other troubles.
Also, do you use standard PostgreSQL packages?
Nice! I think this should be valid for my case. But I’m having some troubles in compilation/installation.
I’ve downloaded the .zip archive from github and I extracted it. From “cmake” folder I execute this command “cmake -DWITH_DD=ON” and then, when I try to execute this one “sudo make install” isn’t work (there’s no rule for install target).
Am I doing something wrong?
Well, that’s hard to tell without more details about the error and your OS, etc…
But have you tried without “-DWITH_DD=ON”? Do you need it?
On Wed, Nov 21, 2012 at 8:05 PM, Tao Romera Martinez <taoromera@gmail.com> wrote:
Hi Iñigo,
I needed to do something similar to what you are trying to do some time ago and asked in the list. Unfortunately, it is not possible to retrieve several shortest paths in one run. It is certainly possible to reduce the time needed to perform the shortest path routing between a set of nodes, but for this the code of the shortest_path C function should be modified to fetch the road network data it needs from the DB only once and then perform the routing algorithm several times.
Thanks for your reply, but in my case the shortest path doesn`t interest me. I need the shortest paths from one given node to each others beacuse then I want to calculate a path taking into account a given time limit.
Something like in the “Traveling Salesman Problem” but with Time Window.
I do not know the answer to you question, but I might know an workarround if you are only interrested in the shortest of them.
We use a hack to find the path to the closest node of a set of nodes.
Basically we tweak the query which builds the graph to rename all nodes which are applicable to some id which cannot be found in the graph elsewere (e.g. -1), and the search for the path to this node.
(NB: this could/would give strange beahviour if used with astar)
I need to obtain a set of nearest nodes from a given location (maybe 30 or 40). Then I need to calculate the shortest path from the given node from each others. It means to execute shortes_path query multiple times in a row, wich takes about 2 seconds (1 query 2 seconds: 30 queries 60 → too long).
SELECT * FROM shortest_path('
SELECT id AS id,
source::int4 AS source,
target::int4 AS target,
cost::float8 AS cost
FROM tt_2po_4pgr',
275742,
274494,
false,
false)
What would be the best way to do this in a reasonable time?
It anybody aware of an gis enabled rule processing engines?
I am looking for something that is capable of walking through a know
directed graph according to a given set of rules.
Starting from node J I need to C
For example I must include node X
I must stay 5km away from nodes H and R
Dave,
You can do all that with pgrouting, but you probably need to write some code that translates rules into pgRouting actions.
One of the things in my "want to do list" is make a wrapper for for shortest path that would allow you to pass it a list of nodes and a flag to follow the list or optimize the list then follow it.
For the avoidance, you can do that today with a little SQL like:
select * from edges
except
select * from edges
where st_dwithin(the_geom,
st_union(
st_buffer(nodeH, 5000),
st_buffer(nodeR, 5000)),
0.0);
You can get pretty fancy with how you select edges and avoid edges.
If the set of rules is not very large this probably could be easily done in perl, python or PHP with the output being the SQL to run the route.