Exemple #1
0
def get_handicap_station_perron(current_opinion_number, stationId, plattformNr):

    if current_opinion_number < 3:
        #check if there is a lift 
        res = dbapi.get_station_agency(stationId)
        binding = json.loads(res.text)
        if 'help_wheelchair_mounting_Train' in binding and getValue(binding['help_wheelchair_mounting_Train']) == 1:
            current_opinion_number = 1

    #the following set it to restricted
    if current_opinion_number >= 4:
        res = dbapi.get_perron(stationId, plattformNr)
        resobj = json.loads(res.text)
        if (len(resobj['results']['bindings']) > 0):
            binding = resobj['results']['bindings'][0]
            if binding['Auftritt'] and getAuftrittScore(binding['Auftritt']) == 1:
                current_opinion_number = 4
            if binding['Hilfstritt'] and getHilfstrittScore(binding['Hilfstritt']) == 1:
                current_opinion_number = 4

    #when there is no steppless access set to assisted
    if current_opinion_number >= 3:
        res = dbapi.get_station_agency(stationId)
        resobj = json.loads(res.text)
        if (len(resobj['results']['bindings']) > 0):
            binding = resobj['results']['bindings'][0]
            if getValue(binding['stepless_access']) == 0: 
                current_opinion_number = 3

    return current_opinion_number
Exemple #2
0
def get_description_for_station(stationId):
    res = dbapi.get_station_agency(stationId)
    resobj = json.loads(res.text)

    result = []
    if (len(resobj['results']['bindings']) > 0):
        binding = resobj['results']['bindings'][0]
        if 'handicapped_accessible_counter' in binding and getValue(binding['handicapped_accessible_counter']) == 1:
            result.append('It is easy to reach a counter.')
        if 'handicapped_accessible_toilett' in binding and getValue(binding['handicapped_accessible_toilett']) == 1:
            result.append('Handicapped accessible restrooms available.')
        if 'help_wheelchair_mounting_Train' in binding and getValue(binding['help_wheelchair_mounting_Train']) == 0:
            result.append('No wheelchair mounting train available.')
        if 'stepless_access' in binding and getValue(binding['stepless_access']) == 0:
            result.append('Unavoidable steps may be present.')

    return result