-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
321 lines (311 loc) · 12.8 KB
/
README
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
CDistRange
├── CDistRange // CDistRange查询的主要代码
│ ├── CDistRange
│ ├── CDistRangeAlgebra.cpp
│ ├── CDistRangeAlgebra.dep
│ ├── CDistRangeAlgebra.h
│ ├── CDistRangeAlgebra.spec
│ ├── CDistRange.examples
│ └── makefile
├── include
│ └── SecondoSMI.h //具体改动见下面
├── Load //从文本中导入数据的操作
│ ├── LoadAlgebra.cpp
│ ├── LoadAlgebra.h
│ ├── LoadAlgebra.spec
│ ├── Load.examples
│ └── makefile
├── README
├── Rectangle
│ └── RectangleAlgebra.h // add define and implement of function MaxDist and MinDist in class Rectangle
├── RTree
│ ├── RTreeAlgebra.cpp
│ ├── RTreeAlgebra.h //add friend class RTreeLevel defination in class RTree;
│ ├── RTreeAlgebra.h.2 // back up file
│ ├── RTreeAlgebra.spec
│ └── RTree.examples
├── script
│ ├── berlintest
│ ├── cdistrange_scr // query script of cdist_range and rtreefilter, tbtreefilter and setifilter
│ └── seti_scr
├── SETI // the SETI code
│ ├── makefile
│ ├── SETIAlgebra.cpp
│ ├── SETIAlgebra.h
│ ├── SETIAlgebra.spec
│ ├── SETI.examples
│ ├── UploadUnit.cpp
│ └── UploadUnit.h
├── Spatial
│ ├── SpatialAlgebra.cpp // 增加函数void WGSGK::setUseWGS(bool b)的实现
│ └── SpatialAlgebra.h // add function define "void setUseWGS(bool b);" in class WGSGK, 用于导入数据时的坐标转换
├── StorageManager
│ ├── bdbBtreeFile.cpp
│ ├── bdbCachedFile.cpp
│ ├── bdbEnvironment.cpp
│ ├── bdbFile.cpp
│ ├── bdbHashFile.cpp
│ ├── bdbKeyedFile.cpp
│ ├── bdbRecord.cpp
│ ├── bdbRecordFile.cpp
│ ├── bdbUpdateFile.cpp
│ ├── makefile
│ ├── SmiBDB.h
│ ├── smiEnvironment.cpp
│ └── smiKey.cpp
├── TBTree
│ └── TBTree.h //具体修改如后面所示
├── Temporal
│ ├── TemporalAlgebra.cpp // add implement of function "int PeriodsAtValInterval(const double& value1, const double& value2, Periods& times)" , "int PeriodsAtValB(const double& value, Periods& times)" and "int PeriodsAtValA(const double& value, Periods& times)".
│ └── TemporalAlgebra.h // add defination of function "int PeriodsAtValInterval(const double& value1, const double& value2, Periods& times)" , "int PeriodsAtValB(const double& value, Periods& times)" and "int PeriodsAtValA(const double& value, Periods& times)".
└── TransportationMode
├── BusNetwork.cpp
├── BusNetwork.h
├── GeneralType.cpp
├── GeneralType.h
├── Indoor2.h
├── Indoor.cpp
├── Indoor.h
├── makefile
├── Partition.cpp
├── Partition.h
├── PaveGraph.cpp
├── PaveGraph.h
├── QueryTM.cpp
├── QueryTM.h
├── RoadNetwork.cpp
├── RoadNetwork.h
├── TMRTree.h
├── TransportationMode.cpp
├── TransportationMode.examples
├── TransportationMode.h
├── TransportationMode.spec
├── Triangulate.cpp
└── Triangulate.h
//***************************************
// SecondoSMI.h文件改动
//***************************************
343 //第343行修改如下
{ Unknown, RecNo, Integer, Float, String, Composite }; -> { Unknown, RecNo, Integer, Longint, Float, String, Composite };
364,365 //364至365行删除
SmiKey( const SmiRecordId key );
SmiKey( const long key );
366,369 //增加一下内容
SmiKey( const long key );
SmiKey( const uint32_t key);
SmiKey( const uint64_t key);
SmiKey( const int64_t key);
387,391 //修改一下内容
bool GetKey( SmiRecordId& key );
bool GetKey( long& key );
bool GetKey( double& key );
bool GetKey( string& key );
bool GetKey( IndexableAttribute* key );
->
bool GetKey( uint32_t& key ) const;
bool GetKey( long& key ) const;
bool GetKey( int64_t& key ) const;
bool GetKey( uint64_t& key ) const;
bool GetKey( double& key ) const;
bool GetKey( string& key ) const;
bool GetKey( IndexableAttribute* key ) const;
402 //修改一下内容
static void Map( const long inData, void* outData );
->
static void Map( const long inData, void* outData );
static void Map( const uint32_t inData, void* outData );
static void Map( const int64_t inData, void* outData );
static void Map( const uint64_t inData, void* outData );
增加函数
static KeyDataType getKeyType(SmiRecordId dummy)
{
return SmiKey::RecNo;
}
425,426 //修改一下内容
void SetKey( const SmiRecordId key );
void SetKey( const long key );
->
void SetKey( const long key);
void SetKey( const uint32_t key);
void SetKey( const int64_t key);
void SetKey( const uint64_t key);
442 //增加定义
uint64_t longintKey;
//***************************************
// TBTree.h文件改动
//***************************************
1166a1167,1168 //第1166行增加以下内容
>
> bulkloading = false;
1176a1179,1180
>
> bulkloading = false;
1474a1479,1614
> /*
> * GetLastLeafNodeofTraj
> * get the last leaf node of trajectory id
> *
> */
> SmiRecordId getLastLeafNodeofTrjId(int trjid){
> stack<SmiRecordId> nodes;
> SmiRecordId sid;
> BasicNode<3> *node = NULL;
> nodes.push(getRootId());
> while(! nodes.empty()){
> // nodes is no empty
> sid = nodes.top();
> nodes.pop();
> if(node != NULL){
> delete node;
> }
> node = getNode(sid);
> if(node->isLeaf()){
> if(((TBLeafNode<3, TupleId>*)node)->getTrjId() == trjid){
> // find the leaf node which id is trjid
> while(((TBLeafNode<3, TupleId>*)node)->getNext() != 0){
> // get the last leaf node of the trjid
> sid = ((TBLeafNode<3, TupleId>*)node)->getNext();
> if(node != NULL){
> delete node;
> }
> node = getNode(sid);
> }
> if(node != NULL){
> delete node;
> }
> return sid;
> }
> else{
> // the trjid of leaf node is different from search trjid
> continue;
> }
> }
> else{
> // the node is inner node
> }
> }
> // can not find the node which id is trjid
> if(node != NULL){
> delete node;
> }
> // append a new empty leaf node, and save to tbtree
> node = getEmptyLeaf(trjid);
> sid = appendLeafNode(*node);
> return sid;
> }
>
> // tbtree bulk load
> void startBulkLoad(){
> // check the flag of bulkloading
> if(bulkloading){
> cout<<"Warning: tbtree is bulk loading!"<<endl;
> return;
> }
> bulkloading = true;
> sidmap.clear();
> nodemap.clear();
> sid = 0;
> basicnode = NULL;
> }
> void endBulkLoad(){
> if(! bulkloading){
> cout<<"Warning: tbtree is no bulk loading now!"<<endl;
> return;
> }
> for(it = nodemap.begin(); it != nodemap.end(); it++){
> updateNode(sidmap[it->first], *(it->second));
> insertLeaf(sidmap[it->first], it->second->getBox());
> }
> nodemap.clear();
> sidmap.clear();
> }
> void bulkLoadInsert(const UPoint &upoint, int trjid, TupleId tid){
> // bulk load tbtree
> it = nodemap.find(trjid);
> if(it == nodemap.end()){
> // node map has not id
> // find the node in tbtree
> sid = getLastLeafNodeofTrjId(trjid);
> basicnode = getNode(sid);
> nodemap[trjid] = basicnode;
> sidmap[trjid] = sid;
> }
> if(((tbtree::Node<3, TBLeafInfo> *)(nodemap[trjid]))->isFull()){
> // the leaf node is full
> // add a new empty node
> basicnode = getEmptyLeaf(trjid);
> sid = appendLeafNode(*basicnode);
> // set the sid of new leaf node as processor's next, and update the processor
> ((TBLeafNode<3, TBLeafInfo>*)(nodemap[trjid]))->setNext(sid);
> updateNode(sidmap[trjid], *(nodemap[trjid]));
> insertLeaf(sidmap[trjid], nodemap[trjid]->getBox());
> // update the node map and sid map
> nodemap[trjid] = basicnode;
> sidmap[trjid] = sid;
> }
> // insert the leaf entry to leaf node
> TBLeafInfo li(tid);
> ((TBLeafNode<3, TBLeafInfo> *)(nodemap[trjid]))->insert(Entry<3, TBLeafInfo>(upoint.BoundingBox(), li));
> noEntries ++;
> }
> void bulkLoadInsert(const Rectangle<3> &upointbbox, int trjid, TupleId tid){
> // bulk load tbtree
> it = nodemap.find(trjid);
> if(it == nodemap.end()){
> // node map has not id
> // find the node in tbtree
> sid = getLastLeafNodeofTrjId(trjid);
> basicnode = getNode(sid);
> nodemap[trjid] = basicnode;
> sidmap[trjid] = sid;
> }
> if(((tbtree::Node<3, TBLeafInfo> *)(nodemap[trjid]))->isFull()){
> // the leaf node is full
> // add a new empty node
> basicnode = getEmptyLeaf(trjid);
> sid = appendLeafNode(*basicnode);
> // set the sid of new leaf node as processor's next, and update the processor
> ((TBLeafNode<3, TBLeafInfo>*)(nodemap[trjid]))->setNext(sid);
> updateNode(sidmap[trjid], *(nodemap[trjid]));
> // update the node map and sid map
> nodemap[trjid] = basicnode;
> sidmap[trjid] = sid;
> }
> // insert the leaf entry to leaf node
> TBLeafInfo li(tid);
> ((TBLeafNode<3, TBLeafInfo> *)(nodemap[trjid]))->insert(Entry<3, TBLeafInfo>(upointbbox, li));
> noEntries ++;
> }
>
1476a1617,1626
>
> // tbtree bulk load
> SmiRecordId sid;
> map<int, SmiRecordId> sidmap;
> tbtree::BasicNode<3> *basicnode, *tmpnode;
> map<int, tbtree::BasicNode<3> *> nodemap;
> map<int, tbtree::BasicNode<3> *>::iterator it;
> bool bulkloading;
> //
>
1619a1770,1790
> SmiRecordId appendLeafNode(const BasicNode<3>& n){
> noNodes++;
> noLeafNodes++;
> unsigned int size = recordLength;
> char buffer[size];
> memset(buffer,0,size);
> char leaf = n.isLeaf()?1:0;
> unsigned int offset = 0;
> memcpy(buffer , &leaf, sizeof(char));
> offset += sizeof(char);
> n.writeTo(buffer, offset);
> SmiRecordId id = 0;
> SmiRecord record;
> file.AppendRecord(id, record);
> SmiSize os = 0; // offset
> SmiSize rss = record.Write(buffer, size, os);
> assert(rss == size);
> record.Finish();
> return id;
> }