Featured image of post 成本距離和最低成本路徑

成本距離和最低成本路徑

找出工廠可以接電線至電廠的最佳與最短距離。

目標

從高壓電拉電線至工廠,需要成本最低的路徑。

Marco Modeler 操作

利用 assign 定義與分類出 worcwest 中每個區域的成本。使用 Edit. 建立一個avl. 檔案,為指派給 assign,取名為 friction,定義如下:

Land UseFriction
Water1000
Deciduous Forest (1, 2, 3)4
Coniferous Forest (1, 2)5
Grass / Suburban1000
Agriculture1
Urban (Resid. , Comm.)1000
Pavement (1, 2)1
Gravel / Barren1
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
1 1000
2 4
3 4
4 4
5 5
6 5
7 1000
8 1
9 1000
10 1000
11 1
12 1
13 1
14 1

worcwest 與分類的 avl. 檔案(friction) 連接 assign,output 的像素檔也取名為 friction。

分好的 fiction 圖。
分好的 fiction 圖。

建立 newplant 這個向量的像素檔,使用 pointras 產生需要參考的像素圖,所以要用 intital 連接任何一張像素圖,我這裡是連接 worcwest,output 的檔案取名為 blank。再把 blank 連接到 pointraspointras 內的資料如下圖:

目前的模型:

要計算成本,新增一個 cost ,output 的檔案取名為 costdistance , cost 中的 Algorithm 選擇 CostGrow。

再把 newplant 跟 friction 輸入進 cost 內,Source feature image 為 newplant;Fiction surface image 為 friction。

此時的模型如下圖:

可以按執行先 output 出 costdistance , cost 的部分會跑得比較久。output 的 costdistance 如下圖:

再從 Vector Layer 開啟高壓電電線 powerline,powerline 是一個向量檔,需要產生一個它的像素檔,使用 lineras 連接,output 的檔案取名為 powerline。

一樣把 blank 連接到 lineras 內,此時 lineras 內部的資料如下圖:

新增 pathway ,output 的檔案取名為 newline。pathway 內 Cost surface image 為 costdistance,Target image 為 powerline ,此時 pathway 內部的資料如下圖:

因為我們只要一條線,所以要把 Multiple pathways 的 Yes 改成 No,output 的結果如下圖:

結果

結果圖

加上圖層 newplant(工廠)與 powerline(高壓電),再去掉背景,就可以看到工廠接電線到高壓電最適合的路徑。

Marco Modeler 的所有流程

comments powered by Disqus
使用 Hugo 建立
主題 StackJimmy 設計