You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
The _geojson method of the Directions class creates a GeoJSON FeatureCollection from the data in the body of a response object.
If the geometry of the FeatureCollection is "LineString", then _geojson calls polyline.decode.
polyline.decode returns coordinates as latitude, longitude tuples, where the GeoJSON standard requires longitude, latitude arrays.
This can make it difficult for a user to create a static map with the FeatureCollection returned by _geojson. (It can, for example, result in validation errors.)
Unless it would have unintended consequences, I propose to make a small change to _geojson.
Current:
'coordinates': polyline.decode(route['geometry'])
Proposed (where "pair" is shorthand for "coordinate pair"):
'coordinates': [
list(reversed(pair)) for pair in polyline.decode(route['geometry'])
]
Incidentally, this also has implications for the Optimization class (/pull/241).
The text was updated successfully, but these errors were encountered:
The
_geojson
method of theDirections
class creates a GeoJSON FeatureCollection from the data in the body of a response object.If the geometry of the FeatureCollection is "LineString", then
_geojson
callspolyline.decode
.polyline.decode
returns coordinates as latitude, longitude tuples, where the GeoJSON standard requires longitude, latitude arrays.This can make it difficult for a user to create a static map with the FeatureCollection returned by
_geojson
. (It can, for example, result in validation errors.)Unless it would have unintended consequences, I propose to make a small change to
_geojson
.Current:
Proposed (where "pair" is shorthand for "coordinate pair"):
Incidentally, this also has implications for the
Optimization
class (/pull/241).The text was updated successfully, but these errors were encountered: