[postgis-users] pgrouting and postgis
Daniel W
gentoo.murray at gmail.com
Tue Jun 10 09:26:27 PDT 2008
Hello,
i am new to Postgis and pgRouting and i am trying to route over some
data, but it doesnt work for me.
I installed a routing database with following commands as described in
the pgrouting online tutorial
(http://pgrouting.postlbs.org/wiki/Workshop-CreateRoutingDatabase).
The data, which i want to use for routing, I got from the
Openstreetmap projekt. I wrote me a program, which parse the xml file
and write the data in a database.
My Table with the name "subways" was created with the following command:
CREATE TABLE subways (ID integer , startNode integer REFERENCES
nodes(ID), endNode integer REFERENCES nodes(ID), cost double
precision, name char(40), x1 double precision, y1 double precision, x2
double precision,y2 double precision, PRIMARY KEY(ID, startNode,
endNode));
And the table looks like that:
id= way id
name = name of the street
startnode, endnode are the IDs of the nodes
x1,y1 are the coordinates of the startnode
x2,y2 are the coordinates of the endnodenode
cost = length of the way
id | startnode | endnode | cost |
name | x1 | y1 | x2 | y2
-------+-----------+-----------+----------------------+------------------------------------------+-----------+------------+-----------+------------
0 | 140530 | 140555 | 8.5403091715829 |
| 8.3889675 | 53.0587826 | 8.28445 |
53.1030248
2 | 206374638 | 26870008 | 0.320998562351643 |
| 8.2145964 | 53.1430959 | 8.2168197 |
53.1405356
3 | 201754820 | 92909800 | 0.172230180241359 | Industriestraße
| 8.1939216 | 53.1498095 | 8.1965042 |
53.1497966
5 | 26869963 | 165748872 | 0.0268226987132517 |
Heiligengeistwall | 8.2087014 | 53.1412273 |
8.208876 | 53.1414446
6 | 165748872 | 26869964 | 0.0208274380181027 |
Heiligengeistwall | 8.208876 | 53.1414446 |
8.2090004 | 53.1416164
(In another Table named nodes, i have every Point-ID with coordinates)
If I try now the routing function A-Star.....
SELECT * FROM shortest_path_astar('SELECT id, startnode as source,
endnode as target, cost, x1, y1, x2, y2 from subways', 31567898,
96012788, false, false);
... I get following error code:
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
I hope you can help me, my system is:
Gentoo Linux 64 Bit
postgresql 8.0.15
postgis 1.3.1
pgrouting 1.02
Best regards,
Daniel
More information about the postgis-users
mailing list