Closed Tristramg closed 6 years ago
Hi @Tristramg
Are you certain that mapbox/polyline uses (lon, lat)? The example on their repo uses [38.5, -120.2]
, which can only be (lat, lon), since the range for lat has to be -90 to 90. They also specifically mention returns an array of lat, lon pairs
.
I have no personal conviction that subscribes to either format, but there are two reasons why I would not advocate for changing the order:
I definitely agree that it's annoying that not everyone follows the same standard, and I should make the order more clear in the documentation of this library. However, I don't think that changing the code is a good idea.
You are right about mapbox’s polyline, I read the answser in the geojson, not the input… sorry for the useless noise.
Your arguments are completly valid.
If only google hadn’t decided to break the order compared to any other GIS…
On 15 February 2018 at 20:19, Frederick Jansen notifications@github.com wrote:
Closed #6 https://github.com/hicsail/polyline/issues/6.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hicsail/polyline/issues/6#event-1476584850, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAvy6Ie9rWEYlxF2gg9hWEB162rF0iSks5tVINJgaJpZM4SDty9 .
Hi @Tristramg, in case it's still useful for you, as of polyline 1.4.0 we now support lon/lat coordinates if you set geojson=True
when decoding/encoding coordinates.
I know it is heated question, and I usually wouldn’t want to impose my point of view.
However, currently, a string is decoded as [(lat, lon)…] while it is (lon, lat) (aka x,y on a planar map) on https://github.com/mapbox/polyline that inspired this library.
This makes it a bit cumbersome to use geojson as it also expects coordinates in the (x,y) order.
I don’t mind fixing it and making a pull request. However, I want to be sure that the original author agrees with that view.