Closed jsantos closed 4 years ago
Same issue here
Hi @jsantos @rafaeljcadena , I tested the given polyline against :
fast-polylines
in version 1.x
: I reproduce the error you see fast-polylines
in version 2.x
(currently in preview, which is a reimplement in C to provide even better performances) : it passes but it seems the returned polyline is different from what you see in the Interactive Polyline Encoder utility.polylines
which is the canonical ruby gem for decoding polylines : it get a TypeError (nil can't be coerced into Float)
on the same polyline.So I wonder if the provided polyline is in fact invalid even if it returns a result for some implementations. Could you give me the original coordinates that generated this polyline ?
@ccyrille I have to dig a bit to fetch the original data, but will post it here as soon as I can. Thanks a lot!
@ccyrille It seems to be related to the double backslash. If you compare both responses (fast-polylines 2.x and IPE utility) you will notice that the result is the same until the occurrence of the first double backslash.
@jsantos @ccyrille Yeah, it is related to the double backslash. If for every double backslash I add one more:
|dae@cs}jSw@Ci@^o@n@q@l@y@Zq@Xw@Xs@Vy@Vu@Vu@Tw@H}@E{@AWv@i@d@s@J}@\\\\y@Jw@Ju@HmAOu@Po@`@o@^o@\\\\m@`@q@\\\\q@b@k@`@u@Ru@Hy@Fy@Ju@Hy@By@Du@Vq@f@Kx@\\\\n@^l@Zz@N|@?x@`@l@dAH`AB|@Bx@Fz@Rp@Xl@\\\\n@Et@a@j@o@^s@Z{@Py@Hw@Bw@C}@Ay@Aw@@y@By@Fw@@u@NKv@Bt@|@X|@FbAFv@CVv@?x@Gx@Mx@Wt@u@Hw@c@e@i@e@o@[o@MaAEeA?cALsGz@uKl@_@z@Sp@\\\\h@n@Rr@Fz@Fz@^n@dAD~@Fz@Dv@Fv@L|@\\\\t@`@n@\\\\bATz@?t@A|@@x@Jx@@`@q@b@u@d@y@\\\\m@\\\\q@b@o@^m@`@k@`@k@^m@p@_@n@e@l@g@r@g@r@e@|@c@r@Ur@Ux@Wp@Qt@Yz@_@t@[p@Wr@Wh@i@Yq@t@_@`@k@M_AYaAW}@s@mA
Then the results from the version 2.x and google IPE are exactly the same.
@democlitos I've tried your polyline, and the results are quite similar. However, IPE add a trailing @
to the polyline. I had to add it as well to get the same result (otherwise there was a missing coordinate).
In the end, both results are identical. I'll close this issue, please open a new one if you have a similar issue. And please also provide us the original coordinates alongside the wronged polyline 🙂
Having the following encoded polyline:
The polyline is valid, you can try plotting it on the Interactive Polyline Encoder Utility.
When I try to decode it, I get the following backtrace:
Anyone has experienced anything similar? Thanks in advance!