Python library supports Mapzen routing
This commit is contained in:
@@ -1 +1,2 @@
|
||||
from redis_tools import RedisConnection
|
||||
from coordinates import Coordinate
|
||||
@@ -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)
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user