91. 5.6 Pythonで動かしてみよう: 到達点の頂点抽出
到達距離の設定
49 #Choosing upper bound vertexes
検索距離を指定します。
50 upperBound = [] ここでは「1000m」と設定
51 angle_dic = {} しています
52 r = 1000.0 #distance
53 i=0
到達範囲の頂点の抽出
55 while i < len(cost):
56 if cost[ i ] > r and tree[ i ] != -1:
57 outVertexId = graph.arc( tree [ i ] ).outVertex()
58 if cost[ outVertexId ] < r:
59
60 ~ 中略 ~
65 i=i+1
91
92. 5.7 Pythonで動かしてみよう: 到達圏ポリゴン作成
到達圏ポリゴン配列のソート
67 geomPolygon = []
68 for key, value in sorted(angle_dic.items()):
69 geomPolygon.append(value)
到達圏ポリゴンのジオメトリテーブルの作成
71 #Create Polygon about areas of the availability
72 Polygonset = [geomPolygon]
73 gPolygon = QgsGeometry.fromPolygon(Polygonset)
92