Skip to content

Commit

Permalink
Implement fix described here: https://github.com/ustroetz/python-osrm…
Browse files Browse the repository at this point in the history
  • Loading branch information
crindt committed Feb 18, 2024
1 parent 8abcd85 commit b8304b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osrm/core.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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

Expand Down

0 comments on commit b8304b9

Please sign in to comment.