-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for lon,lat in addition to lat,lon? #2
Comments
It would have to be an API addition with explicit |
I'm seeing some weirdness with the Encodes and decodes fine with pypolyline, however I have a requirement where decoding happens in the browser and testing with input For example if we use the example from google's docs
and encode with pypolyline
decoding with any other python/nodejs package e.g. polyline (python) or mapbox's polyline npm package yields the reverse (i.e.
I know it's fairly easy to switch the decoded coordinates around, but I would expect the API to yield an encoded string that decodes as the exact input (with some precision) using any other polyline package, given they are all following google's algorithm. Appreciate the work you put into this though! It's really fast compared other packages in python that's for sure. I don't know any rust so I won't be able to put in a PR for the rust binary. Wondering if you or anyone else in the community can help! Cheers! |
The Google Polyline spec requires lat, lon input order and output order (and in fact the EPSG 4326 projection does too), so if you give it input in reversed coordinates you'll get either an incorrect (but valid) string as output, or an error (if either of the input coordinates are out of bounds)
But that isn't the example from Google's docs. The coordinates have been reversed – they're no longer valid EPGSG 4326 coordinates OR Polyline input coordinates as per its spec. As I said in the previous comment, there's no way to reliably detect the order of input coordinates; e.g. (80.0, 10.0) is valid input in both cases. I'm happy to accept a PR that adds new methods with specified input order – that's all Python anyway, no Rust knowledge required. |
How about also supporting co-ordinate lists that are represented as longitude, latitude?
These are handled by the other
polyline
package:The text was updated successfully, but these errors were encountered: