Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Swap coordinates in GeoJSON response
Browse files Browse the repository at this point in the history
Resolves #262
  • Loading branch information
Sean Gillies committed Nov 29, 2018
1 parent 986e060 commit ed8920f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changes
=======

0.17.2 (TBD)
------------
- Coordinates have been swapped to get the proper order in the GeoJSON response
from the Directions service (#262).

0.17.1 (2018-09-26)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion mapbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# mapbox
__version__ = "0.17.1"
__version__ = "0.17.2"

from .services.datasets import Datasets
from .services.directions import Directions
Expand Down
2 changes: 1 addition & 1 deletion mapbox/services/directions.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def _geojson(self, data, geom_format=None):
# convert default polyline encoded geometry
geom = {
'type': 'LineString',
'coordinates': polyline.decode(route['geometry'])}
'coordinates': [(lng, lat) for lat, lng in polyline.decode(route['geometry'])]}

feature = {
'type': 'Feature',
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tox]
envlist =
py27,py34,py35,py36
py27,py36

[testenv]
deps =
pytest-cov
responses
commands =
py.test --cov mapbox --cov-report term-missing
python -m pytest --cov mapbox --cov-report term-missing

0 comments on commit ed8920f

Please sign in to comment.