Python library supports Mapzen routing

This commit is contained in:
Mario de Frutos
2016-02-23 12:35:12 +01:00
parent 2a807af6df
commit d2e73a69fa
13 changed files with 272 additions and 5 deletions

View File

@@ -1 +1,2 @@
from redis_tools import RedisConnection
from coordinates import Coordinate

View File

@@ -0,0 +1,19 @@
class Coordinate:
"""Class that represents a generic form of coordinates to be used
by the services """
def __init__(self, longitude, latitude):
self._longitude = longitude
self._latitude = latitude
@property
def latitude(self):
return self._latitude
@property
def longitude(self):
return self._longitude
def to_json(self):
return "{{\"lon\": {0},\"lat\": {1}}}".format(self._longitude,
self._latitude)

View File

@@ -6,8 +6,6 @@ class RedisConnection:
REDIS_DEFAULT_USER_DB = 5
REDIS_DEFAULT_TIMEOUT = 2 #seconds
#REDIS_SENTINEL_DEFAULT_PORT = 26379
#REDIS_DEFAULT_PORT = 6379
def __init__(self, sentinel_master_id, redis_host, redis_port,
redis_db=REDIS_DEFAULT_USER_DB, **kwargs):