-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_loop.py
57 lines (39 loc) · 1.63 KB
/
test_loop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from forestcost import main_model as m
from forestcost import routing as r
from pprint import pprint
import ogr
def main():
### Harvest Type (clear cut = 0, partial cut = 1)
PartialCut = 0
### GIS Data
slope_raster = 'G:\\Basedata\\PNW\\terrain\\slope'
elevation_raster = 'G:\\Basedata\\PNW\\terrain\\dem_prjr6'
driver = ogr.GetDriverByName('ESRI Shapefile')
property_shp = driver.Open('U:\\My Documents\Tool\\Data\\testarea6.shp', 0)
property_lyr = property_shp.GetLayer()
stand_lyr = property_shp.GetLayer()
### Mill information
mill_shp = 'U:\\My Documents\Tool\\Data\\mills.shp'
# landing_geom, haulDist, haulTime, coord_mill = r.routing(property_lyr, mill_shp=mill_shp)
import csv
data = csv.reader(open('C:\\Users\\ustroetz\\Downloads\\fvsaggregate.csv', 'rb'))
data.next()
for row in data:
print row[1]
### Tree Data ###
# Hardwood Fraction
HdwdFractionCT = 0.15
HdwdFractionSLT = 0.0
HdwdFractionLLT = 0.0
# Chip Trees
RemovalsCT = float(row[19])
TreeVolCT = float(row[17])
# Small Log Trees
RemovalsSLT = float(row[29])
TreeVolSLT = float(row[27])
# Large Log Trees
RemovalsLLT = float(row[43])
TreeVolLLT = float(row[41])
print RemovalsCT, RemovalsSLT, RemovalsLLT
# pprint (m.cost_func(slope_raster, elevation_raster, stand_lyr, mill_lyr, RemovalsCT, TreeVolCT, RemovalsSLT, TreeVolSLT, RemovalsLLT, TreeVolLLT, HdwdFractionCT, HdwdFractionSLT, HdwdFractionLLT, PartialCut, landing_geom, haulDist, haulTime, coord_mill))
main()