Saturday, 12 August 2017

qgis - pgrouting unexpected output


Thats my ways.shp file. I loaded this to PostgreSQL DB using PostGIS shape file loader. I ran pgr_anlayzeGraph() on it and found it had a lot of isolated segments.


Next I ran pgr_nodeNetwork() to create a new table 'ways_ways'. I made the topology for it and ran the following query in Qgis sql window.


 SELECT * FROM ways_ways JOIN (SELECT seq, id1 AS node, id2 AS edge, cost FROM 
pgr_astar('SELECT id, source, target, cost, x1, y1, x2, y2 FROM ways_ways',
1, 108, false, false) )AS route ON ways_ways.id = route.node;

Given below are the screenshots: Original floorplan and the prescribed route 1 query ouput 2


Clearly , I don't have a continuous output. I ran pgr_analyseGraph on ways_ways to find that it has no more isolated segments . It has 51 deadends, which is acceptable.




  1. Did I miss any step in pgrouting?

  2. Is there anyway to see which node has id 1 and id 108 in qgis?

  3. i ran the same query in another map(which i downloaded) and got output for all possible source and target ids. So how can i create a way(a route) that is completely noded?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...