Removed dependency with polyline and use our implementation
This commit is contained in:
@@ -1,10 +1,9 @@
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
from polyline.codec import PolylineCodec
|
|
||||||
|
|
||||||
from exceptions import WrongParams
|
from exceptions import WrongParams
|
||||||
from cartodb_services.tools import Coordinate
|
from cartodb_services.tools import Coordinate, PolyLine
|
||||||
|
|
||||||
|
|
||||||
class MapzenRouting:
|
class MapzenRouting:
|
||||||
@@ -74,7 +73,7 @@ class MapzenRouting:
|
|||||||
try:
|
try:
|
||||||
parsed_json_response = json.loads(response)
|
parsed_json_response = json.loads(response)
|
||||||
legs = parsed_json_response['trip']['legs'][0]
|
legs = parsed_json_response['trip']['legs'][0]
|
||||||
shape = PolylineCodec().decode(legs['shape'])
|
shape = PolyLine().decode(legs['shape'])
|
||||||
length = legs['summary']['length']
|
length = legs['summary']['length']
|
||||||
duration = legs['summary']['time']
|
duration = legs['summary']['time']
|
||||||
routing_response = MapzenRoutingResponse(shape, length, duration)
|
routing_response = MapzenRoutingResponse(shape, length, duration)
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ python-dateutil==2.2
|
|||||||
googlemaps==2.4.2
|
googlemaps==2.4.2
|
||||||
# Dependency for googlemaps package
|
# Dependency for googlemaps package
|
||||||
requests<=2.9.1
|
requests<=2.9.1
|
||||||
polyline==1.1
|
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
mock==1.3.0
|
mock==1.3.0
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from setuptools import setup, find_packages
|
|||||||
setup(
|
setup(
|
||||||
name='cartodb_services',
|
name='cartodb_services',
|
||||||
|
|
||||||
version='0.3.0',
|
version='0.3.1',
|
||||||
|
|
||||||
description='CartoDB Services API Python Library',
|
description='CartoDB Services API Python Library',
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user