码迷,mamicode.com
首页 > 其他好文 > 详细

PostGIS pgrouting

时间:2017-05-06 16:31:33      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:0.00   gis   nbsp   gid   str   bsp   false   cost   post   

alter table roadline add column source integer;
alter table roadline add column target integer;
select pgr_createTopology(‘roadline‘, 0.0001, ‘geom‘, ‘gid‘);

SELECT seq, id1 AS node, id2 AS edge, cost, geom
  FROM pgr_dijkstra(
    ‘SELECT gid as id, source, target, st_length(geom) as cost FROM roadline‘,
    1, 2, false, false
  ) as di
JOIN roadline pt
ON di.id2 = pt.gid ;

PostGIS pgrouting

标签:0.00   gis   nbsp   gid   str   bsp   false   cost   post   

原文地址:http://www.cnblogs.com/ytwy/p/6817012.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!