changeset 456:825e5d49325d

slight update
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Wed, 19 Feb 2014 16:30:45 -0500
parents abe0b2347d4c
children 95a8eb38d9a2
files python/pavement.py python/utils.py
diffstat 2 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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