-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreateindoor.sec
More file actions
104 lines (53 loc) · 2.39 KB
/
Copy pathcreateindoor.sec
File metadata and controls
104 lines (53 loc) · 2.39 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
@createuniversity.sec;
@createoffice24.sec;
@createcinema.sec;
@createtrainstation.sec;
@createhotel.sec;
@createhospital.sec;
@createmall.sec;
@createoffice38.sec;
## get large 2D area and ignore triangles: convex: concave:
let region_elems = region_elem feed extend[Area:area(.Covarea)]
filter[(.Area > 100.0)] remove[Id, Area] addcounter[Id, 1] project[Id, Covarea] consume;
let new_region_elems = remove_dirty(region_elems, Id, Covarea) consume;
delete region_elems;
let center_point = center(bbox(newboundary));
let center_dist = (maxD(bbox(newboundary),1) - minD(bbox(newboundary),1))/2;
let dist_type = fun(poly:rect)
ifthenelse(distance(center_point, poly) < center_dist/5, 1,
(ifthenelse( distance(center_point, poly) < 2*center_dist/5, 2,3
)
)
);
## get the rectangle areas for all buildings ##
let building_region = getrect1(new_region_elems, Id, Covarea, building_para) consume;
let building_region_type = building_region feed extend[Reg_type:dist_type(.GeoData)] consume;
delete building_region;
let btree_type = building_region_type createbtree[Reg_type];
### set the type (building) for each rectangle ###
let building_sort = building_region_type feed sortby[GeoData] consume;
delete building_region_type;
let rtree_build = building_sort feed addid bulkloadrtree[GeoData];
let buildingplustype = set_building_type(building_sort, rtree_build, space_1) sortby[GeoData] consume;
let btree_building = buildingplustype createbtree[Poly_id];
### build the connection from building entrance to pavement area ##
let building_paths = path_to_building(buildingplustype, new_region_elems, btree_building, space_1) consume;
delete new_region_elems;
delete building_sort;
delete rtree_build;
delete btree_type;
delete center_point;
delete center_dist;
##### create the indoor framework####
let indoorinfra1 = theindoor(1, building_paths, buildingplustype);
########## put the indoor infrastructure into the global space #######
query putinfra(space_1, indoorinfra1) consume;
######### get buildings nearby bus and metro stops ################
let bstops_build = nearstops_building(space_1, "Bus") consume;
let mstops_build = nearstops_building(space_1, "Metro") consume;
###### put the two relations into space #####
query putrel(space_1, bstops_build) consume;
query putrel(space_1, mstops_build) consume;
delete bstops_build;
delete mstops_build;
delete building_para;