forked from hcc226/UrbanMotionAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvPOICSVToJSON.py
More file actions
36 lines (29 loc) · 897 Bytes
/
convPOICSVToJSON.py
File metadata and controls
36 lines (29 loc) · 897 Bytes
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 将 POI 类/ Admin 类文件(例如 uniPOIDistribution.py)中生成的 CSV / [node 或者 edge] 结果转化成 JSON 格式并汇集到一个文件,准备存入 mongoDB
import sys
import time
from util.csvToMatrixJson import csvToMatrixJson
if __name__ == '__main__':
STARTTIME = time.time()
print "Start approach at %s" % STARTTIME
# CSV -> Mongo.node.sample.js[ppoint]
csvToMatrixJson({
'keys': [],
'DIRECTORY': '/datahouse/tao.jiang/bj-newvis-sg',
'FilePrefix': 'ppoint-j',
'INUM': 20,
'type': 'node'
}).run()
# CSV -> Mongo.edge.sample.js[ppedge]
# csvToMatrixJson({
# 'keys': [],
# 'DIRECTORY': '/enigma/tao.jiang/datasets/JingJinJi/records/bj-newvis-sg',
# 'FilePrefix': 'ppedge-',
# 'INUM': 20,
# 'type': 'edge'
# }).run()
# CSV -> [apoint]
# CSV -> [aaedge]
print "END TIME: %s" % time.time()