urschrei / pypolyline

Fast Google Polyline encoding and decoding using a Rust binary
https://pypi.python.org/pypi/pypolyline
Other
38 stars 2 forks source link

decode to lon,lat? #69

Open paro- opened 1 month ago

paro- commented 1 month ago

Hi,

My objective is to decode this polyline, which comes from Valhalla, to lat,lon coordinates.

import polyline
polyline.decode(poly, 6)

gives me the expected result, but:

from pypolyline.cutil import decode_polyline
decode_polyline(str.encode(poly), 6)

yields a lon,lat result, that I then I have to reverse.

Am I missing something?

Best regards, Paul

urschrei commented 1 month ago

This library uses lon, lat order, as noted in the README. There's no option to swap it.

paro- commented 1 month ago

Okay, thanks, my bad I was going with the cutil.pyx function comments.