diff --git a/osrm/core.py b/osrm/core.py index c21469d..1751a3d 100644 --- a/osrm/core.py +++ b/osrm/core.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import numpy as np -from polyline.codec import PolylineCodec +from polyline from polyline import encode as polyline_encode from pandas import DataFrame from . import RequestConfig @@ -102,7 +102,7 @@ def match(points, steps=False, overview="simplified", geometry="polyline", geom_encoded = r_json["matchings"][i]["geometry"] geom_decoded = [[point[1] / 10.0, point[0] / 10.0] for point - in PolylineCodec().decode(geom_encoded)] + in polyline.decode(geom_encoded)] r_json["matchings"][i]["geometry"] = geom_decoded else: print('No matching geometry to decode') @@ -126,7 +126,7 @@ def decode_geom(encoded_polyline): """ ma_ligne = Geometry(2) lineAddPts = ma_ligne.AddPoint_2D - for coord in PolylineCodec().decode(encoded_polyline): + for coord in polyline.decode(encoded_polyline): lineAddPts(coord[1], coord[0]) return ma_ligne