def main(): userid = 128 gps_obj_list = dbutils.get_gps_record_time_order(userid, 0,-1) dbutils.close_db(); print "next" dirName = "%d_points_dir_baidu_pos" %userid if not os.path.exists(dirName): os.mkdir(dirName) distPointList = [] i = 0 j = 0 for p in chunks (gps_obj_list,100): i = i + 1 distPointList += convert_coordinate.convert_coordinate_post(p) if i >=1000: savePointsToJson(userid, j, distPointList) distPointList = [] j = j + 1 i = 0 savePointsToJson(userid, j, distPointList)
def main(): userid = 128 gps_obj_list = dbutils.get_gps_record_time_order(userid, 0, -1) dbutils.close_db() print "next" dirName = "%d_points_dir_baidu_pos" % userid if not os.path.exists(dirName): os.mkdir(dirName) distPointList = [] i = 0 j = 0 for p in chunks(gps_obj_list, 100): i = i + 1 distPointList += convert_coordinate.convert_coordinate_post(p) if i >= 1000: savePointsToJson(userid, j, distPointList) distPointList = [] j = j + 1 i = 0 savePointsToJson(userid, j, distPointList)
def close_conn(): global dbConn if (dbConn): dbutils.close_db(dbConn)
def close_conn(): global dbConn if dbConn: dbutils.close_db(dbConn)