def getMesh(mesh, readFileName, writeFileName):
    cnt = 0
    wf = open(writeFileName, 'w')
    with open(readFileName, 'r') as rf:
        for line in csv.reader(rf):
            if ((cnt % 1000000) == 0):
                print(cnt)
            tid = line[0]
            timestamp = line[1]
            p = Point(float(line[2]), float(line[3]))
            meshid = mesh.inWhichGrid(p)
            wf.write((','.join([tid, timestamp, str(meshid)]) + '\n'))
            cnt += 1
    wf.close()
def getMesh(mesh, readFileName, writeFileName):
    cnt = 0
    wf = open(writeFileName, 'w')
    with open(readFileName, 'r') as rf:
        for line in csv.reader(rf):
            if ((cnt % 1000000) == 0):
                print(cnt)
            tid = line[0]
            timestamp = line[1]
            p = Point(float(line[2]), float(line[3]))
            meshid = mesh.inWhichGrid(p)
            wf.write((','.join([tid, timestamp, str(meshid)]) + '\n'))
            cnt += 1
    wf.close()