frederickjansen / polyline

A Python implementation of Google's Encoded Polyline Algorithm Format.
http://goo.gl/PvXf8Y
MIT License
114 stars 19 forks source link

Add support for lonlat, as per GeoJSON #7

Closed aseelye closed 5 years ago

aseelye commented 5 years ago

I found working with MongoDB that the GeoJSON spec says to use lonlat instead of the common latlon. Using the _latlon methods is much easier than employing a .reverse() on all the sub-lists in the list of tuples to encode/decode.

frederickjansen commented 5 years ago

I think I would rather add this is a parameter to the existing method rather than adding new methods. Let me take a closer look at how this can be done in an elegant way.

aseelye commented 5 years ago

Oh that's a better idea. Maybe add a parameter like geojson = False and if it's set to true do a polylist = [t[::-1] for t in polylist] before returning the list? I'm on mobile but can resubmit next week.

Thanks

-Aaron

On May 25, 2019, at 2:01 PM, Frederick Jansen notifications@github.com wrote:

I think I would rather add this is a parameter to the existing method rather than adding new methods. Let me take a closer look at how this can be done in an elegant way.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

aseelye commented 5 years ago

Closing this in favor of a cleaner method to follow.