« Return to Thread: Help with pgRouting & PostGIS

Re: Help with pgRouting & PostGIS

by Green-8 :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hello Pedro,

Thank you very much for your mail. Yes, I have created two dataset (a) node (b) edge as you said. I was looking at the sample data given in PostLBS which has something like

CREATE TABLE "kanagawa" (gid serial PRIMARY KEY,
"length" numeric,
"x1" numeric,
"y1" numeric,
"x2" numeric,
"y2" numeric,
"source" int8,
"target" int8);
SELECT AddGeometryColumn('','kanagawa','the_geom','-1','MULTILINESTRING',2);
COPY "kanagawa" ("length","x1","y1","x2","y2","source","target",the_geom) FROM stdin;

In the edge data from OpenJump we have start and end nodes which will be source and target. Can you please point me out about how to get the rest of the columns. Which are the columns need to transfered from nodes layer and can I just use length(the_geom) to get the length column ?.

Thanks
Green.

On 25/04/07, Pedro Doria Meunier <pdoria@...> wrote:

Hey Green,

 

I have fiddled with this some time ago... (and I also was left scratching my head for a while :] )

 

Here's what I've concocted:

 

Using OpenJump:

There a tool called 'Planar Graph' under tools->analysis

(uncheck create faces)

 

You're give two layers à one with all the nodes (and their IDs) and the other with the edges.

The latter gives you the start and end nodes for each segment…

Since pgrouting works by setting turning costs for each node… You just have to add another field to this layer and set each node's turning cost… ;-)

(you could, of course, transfer the attributes from the original layer (such as labels, names, etc…) to this layer…)

 

From this point on it's a matter of deciding what you want to do under a programmatical point of view…

 

So you see you don't have to go nuts with all that unfinished topology support… ;-)

 

HTH,

Pedro Doria Meunier

 

 

From: postgis-users-bounces@... [mailto:postgis-users-bounces@...] On Behalf Of Green
Sent: quarta-feira, 25 de Abril de 2007 11:15
To: postgis-users@...
Subject: [postgis-users] Help with pgRouting & PostGIS

 

Hi,

I have been using PostGIS for a while and it works great for my requirement. I have roads & streets as shapefile and now, I wanted to a find the shortest route between locations.

I found pgRouting during the search process. There they talk about topology. They have suggested to use 3 tools for creating data for pgRouting and I don't have access to 2 of them. The one that is familiar to me is PostGIS. I intalled the topology functions and I am struck without any direction. Now what ?

I request any one of you help me and I would greatly appreciate.

I have shapefiles of roads and how do I create data for pgRouting ?

Thanks
Green


_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

 « Return to Thread: Help with pgRouting & PostGIS