# 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
            p_str = {
                    'cost': [],
                    'type': 'FeatureCollection',
                    'crs': {
                        'type': 'EPSG',
                        'properties': {
                            'code': 4326,
                            'coordinate_order': [1,0]
                            }
                        }
                    }
            for c in path.cost:
                p_str['cost'].append(c)

            features = []
            feature = {'type': 'feature'}
            geometry = {'type': 'Linestring'}
            coordinates = []
            last_node = path.nodes[0]
            last_coord = self.g.coordinates(last_node)
            for node in path.nodes:
                coord = self.g.coordinates(node)
                if(last_coord[3] != coord[3]):
                    geometry['coordinates'] = coordinates
                    feature['geometry'] = geometry
                    feature['properties'] = {'layer': last_coord[3]}
                    features.append(feature)

                    feature = {'type': 'feature'}
                    geometry = {'type': 'Linestring'}

# 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

            p_str = {
                    'cost': [],
                    'type': 'FeatureCollection',
                    'crs': {
                        'type': 'EPSG',
                        'properties': {
                            'code': 4326,
                            'coordinate_order': [1,0]
                            }
                        }
                    }
            for c in path.cost:
                p_str['cost'].append(c)

            features = []
            feature = {'type': 'feature'}
            geometry = {'type': 'Linestring'}
            coordinates = []
            last_node = path.nodes[0]
            last_coord = self.g.coordinates(last_node)
            for node in path.nodes:
                coord = self.g.coordinates(node)
                if(last_coord[3] != coord[3]):
                    geometry['coordinates'] = coordinates
                    feature['geometry'] = geometry
                    feature['properties'] = {'layer': last_coord[3]}
                    features.append(feature)

                    feature = {'type': 'feature'}
                    geometry = {'type': 'Linestring'}

                    coordinates = []