# HG changeset patch # User Nicolas Saunier # Date 1392845445 18000 # Node ID 825e5d49325d2cfdad36ee2eb5f08e3182df2cf8 # Parent abe0b2347d4cbbf2e853c483a2636765c3381ab9 slight update diff -r abe0b2347d4c -r 825e5d49325d python/pavement.py --- a/python/pavement.py Tue Feb 18 14:52:49 2014 -0500 +++ b/python/pavement.py Wed Feb 19 16:30:45 2014 -0500 @@ -12,6 +12,20 @@ 5: 7 #0 to 15 } +roadFunctionalClasses = {40: "Collectrice", + 20: "Nationale", + 30: "Regionale", + 10: "Autoroute", + 60: "Acces ressources", + 51: "Local 1", + 52: "Local 2", + 53: "Local 3" + 15: "Aut (PRN)", + 25: "Nat (PRN)", + 70: "Acces isolees", + 99: "Autres" + } + def occ_max(a): if a != []: s = set(a) diff -r abe0b2347d4c -r 825e5d49325d python/utils.py --- a/python/utils.py Tue Feb 18 14:52:49 2014 -0500 +++ b/python/utils.py Wed Feb 19 16:30:45 2014 -0500 @@ -273,7 +273,9 @@ ######################### def mostCommon(L): - '''Returns the most frequent element in a iterable''' + '''Returns the most frequent element in a iterable + + taken from http://stackoverflow.com/questions/1518522/python-most-common-element-in-a-list''' from itertools import groupby from operator import itemgetter # get an iterable of (item, iterable) pairs