# Path: lib/layer.py
# def layer(self, node):
#     for l in self.node_to_layer:
#         if int(node) < l[0]:
#             return l[1]
#     print "Unable to find the right layer for node {0}".format(node)
#     print self.node_to_layer
# 
# Path: lib/bikestations.py
# def get_text(node):
# def get_int(node):
# def get_float(node):
#     def __init__(self, url, name, metadata):
#     def import_data(self):
#     def update_from_db(self):
#     def to_string(self):
# class BikeStationImporter():
# 
# Path: web/shorturl.py
# class shortURL:
#     def __init__(self,metadata):
#     def addRouteToDatabase(self,lonMap,latMap,zoom,lonStart,latStart,lonDest,latDest,addressStart,addressDest, time):
#     def getDataFromHash(self,value):


from lib.core import mumoro
from lib.core.mumoro import Bike, Car, Foot, PublicTransport, cost, co2, dist, elevation, line_change, mode_change, Costs
from lib import layer
from lib import bikestations as bikestations
from web import shorturl
from sqlalchemy import *
from sqlalchemy.orm import mapper, sessionmaker, clear_mappers
from cherrypy import request
from genshi.template import TemplateLoader
import cherrypy
import sys
import simplejson as json
import os
import time
import urllib
import httplib
import hashlib
import datetime
            elif t >= 3:
                p = p + self.normalise_paths( mumoro.martins(s, d, self.g.graph,c['seconds'], c['days'], tmp[0], tmp[1], tmp[2] ), [ tmp[0], tmp[1], tmp[2] ], u_obj )
        #Creates the array containing the user-oriented string for each objective
        str_obj = ['Duration']
        for j in u_obj:
            if j == mumoro.dist:
                str_obj.append( 'Distance' )
            elif j == mumoro.cost:
                str_obj.append( 'Cost' )
            elif j == mumoro.elevation:
                str_obj.append( 'Elevation ' )
            elif j == mumoro.co2:
                str_obj.append( 'CO2 Emission' )
            elif j == mumoro.mode_change:
                str_obj.append( 'Mode Change' )
            elif j == mumoro.line_change:
                str_obj.append( 'Line Change' )
        cherrypy.response.headers['Content-Type']= 'application/json'
        if len(p) == 0:
            return json.dumps({'error': 'No route found'})
        print "Len of routes " + str( len( p ) )
        ret = {
                'objectives': str_obj,
                'paths': []
                }
        for path in p:
            p_str = {
                    'cost': [],
                    'type': 'FeatureCollection',
                    'crs': {

# Path: lib/layer.py
# def layer(self, node):
#     for l in self.node_to_layer:
#         if int(node) < l[0]:
#             return l[1]
#     print "Unable to find the right layer for node {0}".format(node)
#     print self.node_to_layer
# 
# Path: lib/bikestations.py
# def get_text(node):
# def get_int(node):
# def get_float(node):
#     def __init__(self, url, name, metadata):
#     def import_data(self):
#     def update_from_db(self):
#     def to_string(self):
# class BikeStationImporter():
# 
# Path: web/shorturl.py
# class shortURL:
#     def __init__(self,metadata):
#     def addRouteToDatabase(self,lonMap,latMap,zoom,lonStart,latStart,lonDest,latDest,addressStart,addressDest, time):
#     def getDataFromHash(self,value):


# Path: server.py
from lib.core import mumoro
from lib.core.mumoro import Bike, Car, Foot, PublicTransport, cost, co2, dist, elevation, line_change, mode_change, Costs
from lib import layer
from lib import bikestations as bikestations
from web import shorturl
from sqlalchemy import *
from sqlalchemy.orm import mapper, sessionmaker, clear_mappers
from cherrypy import request
from genshi.template import TemplateLoader
import cherrypy
import sys
import simplejson as json
import os
import time
import urllib
import httplib
import hashlib
import datetime

            elif t >= 3:
                p = p + self.normalise_paths( mumoro.martins(s, d, self.g.graph,c['seconds'], c['days'], tmp[0], tmp[1], tmp[2] ), [ tmp[0], tmp[1], tmp[2] ], u_obj )
        #Creates the array containing the user-oriented string for each objective
        str_obj = ['Duration']
        for j in u_obj:
            if j == mumoro.dist:
                str_obj.append( 'Distance' )
            elif j == mumoro.cost:
                str_obj.append( 'Cost' )
            elif j == mumoro.elevation:
                str_obj.append( 'Elevation ' )
            elif j == mumoro.co2:
                str_obj.append( 'CO2 Emission' )
            elif j == mumoro.mode_change:
                str_obj.append( 'Mode Change' )
            elif j == mumoro.line_change:
                str_obj.append( 'Line Change' )
        cherrypy.response.headers['Content-Type']= 'application/json'
        if len(p) == 0:
            return json.dumps({'error': 'No route found'})
        print "Len of routes " + str( len( p ) )
        ret = {
                'objectives': str_obj,
                'paths': []
                }
        for path in p:
            p_str = {
                    'cost': [],
                    'type': 'FeatureCollection',
                    'crs': {

                        'type': 'EPSG',