Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Following the post:pgRouting 2.0 for Windows quick guide, cuz I have some problem with DB manager(here is the problem I posted:DB manager in QGIS 2.0), I skip DB manager and save the test shapefile, using SPIT load the shapefile into PostgreSQL.

Then I type this SQL in pgAdmin:

alter table network.publictransport add column source integer;
alter table network.publictransport add column target integer;
select pgr_createTopology('network.publictransport', 0.0001, 'the_geom', 'gid');

and go check the table below:enter image description here

Then I type in this SQL as in Anita's post:

SELECT seq, id1 AS node, id2 AS edge, cost, geom
FROM pgr_dijkstra(
'SELECT id, source, target, st_length(geom) as cost FROM network.publictransport',
1, 3000, false, false
) as di
JOIN network.publictransport pt
ON di.id2 = pt.id ;

but the message below shows: enter image description here

I am new to SQL, and I don't know how to modify the SQL to get the same result as in Anita's post. Please give some advice to solve this problem.

share|improve this question
    
It looks like you haven't created a view for pt. anitagraser.com/2013/07/07/… might be better for you. –  BradHards Dec 3 '13 at 7:57
    
I tried the SQL in your answer, but got the same result in my post above. Actually I don't know what "created a view for pt." means. –  Heinz Dec 3 '13 at 8:07
    
You are trying a JOIN. That JOIN is ON di.id2 = pt.id. But where does pt come from? –  BradHards Dec 3 '13 at 8:13
    
Thanks, I probably know it. And I typed in the SQL in this post:Public transport isochrones with pgRouting, the SQL went successful and no result. So again I tried the SQL in my post and got the same result as I said. What should I do or Where was the mistake in my process? –  Heinz Dec 3 '13 at 8:31
    
Please use SET lc_messages TO 'en_US.UTF-8'; before running the query. –  Jakub Kania Dec 3 '13 at 13:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.