コード例 #1
0
def readRawFCD(rawFcdPath, sim=False):
    """Reads the Raw-FCD-File and creates a list of Id's with a belonging List of Data tuples."""
    rawDict={}
    inputFile=open(rawFcdPath,'r')
    inputFile.seek(30)
    for line in inputFile:
        words= line.split("\t") 
        if sim: #id's of simulation raw data must be converted
            words[0]=getSimTaxiId(words[0])
              
        if words[0] in rawDict:            
            #           Veh_ID            time                     lat       lon        speed
            rawDict[words[0]].append((getTimeInSecs(words[1]), words[3], words[2], words[5][:-1]))
        else:
            #           Veh_ID            time               lat       lon        speed
            rawDict[words[0]]=[(getTimeInSecs(words[1]),words[3], words[2], words[5][:-1])]        
    inputFile.close()
    return rawDict
コード例 #2
0
def readRawFCD(rawFcdPath, sim=False):
    """Reads the Raw-FCD-File and creates a list of Id's with a belonging List of Data tuples."""
    rawDict = {}
    inputFile = open(rawFcdPath, 'r')
    inputFile.seek(30)
    for line in inputFile:
        words = line.split("\t")
        if sim:  #id's of simulation raw data must be converted
            words[0] = getSimTaxiId(words[0])

        if words[0] in rawDict:
            #           Veh_ID            time                     lat       lon        speed
            rawDict[words[0]].append(
                (getTimeInSecs(words[1]), words[3], words[2], words[5][:-1]))
        else:
            #           Veh_ID            time               lat       lon        speed
            rawDict[words[0]] = [(getTimeInSecs(words[1]), words[3], words[2],
                                  words[5][:-1])]
    inputFile.close()
    return rawDict