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