Skip to content
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

Fix#32 #33

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion routingpy/isochrone.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ def __init__(self, geometry=None, interval=None, center=None):
@property
def geometry(self):
"""
The geometry of the isochrone as [[lon1, lat1], [lon2, lat2], ...] list.
The geometry of the isochrone as [[[lon1, lat1], [lon2, lat2], ...]] list.
chrstnbwnkl marked this conversation as resolved.
Show resolved Hide resolved

:rtype: list or None

.. note::
Since it's not known whether providers' responses adhere to OGC standards, caution is advised with regard
to possible orientation issues of Polygons.
chrstnbwnkl marked this conversation as resolved.
Show resolved Hide resolved
"""
return self._geometry

Expand Down
2 changes: 1 addition & 1 deletion routingpy/routers/graphhopper.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def _parse_isochrone_json(response, type, max_range, buckets, center):
isochrones.append(
Isochrone(
geometry=[
l[:2] for l in polygon["geometry"]["coordinates"][0] # noqa: E741
[l[:2] for l in polygon["geometry"]["coordinates"][0]] # noqa: E741
], # takes in elevation for some reason
interval=int(max_range * ((polygon["properties"]["bucket"] + 1) / buckets)),
center=center,
Expand Down
2 changes: 1 addition & 1 deletion routingpy/routers/mapbox_osrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _parse_isochrone_json(response, intervals, locations):
return Isochrones(
[
Isochrone(
geometry=isochrone["geometry"]["coordinates"],
geometry=[isochrone["geometry"]["coordinates"]],
interval=intervals[idx],
center=locations,
)
Expand Down
2 changes: 1 addition & 1 deletion routingpy/routers/openrouteservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def _parse_isochrone_json(response):
for idx, isochrone in enumerate(response["features"]):
isochrones.append(
Isochrone(
geometry=isochrone["geometry"]["coordinates"][0],
geometry=isochrone["geometry"]["coordinates"],
interval=isochrone["properties"]["value"],
center=isochrone["properties"]["center"],
)
Expand Down
2 changes: 1 addition & 1 deletion routingpy/routers/valhalla.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def _parse_isochrone_json(response, intervals, locations):
if feature["geometry"]["type"] in ("LineString", "Polygon"):
isochrones.append(
Isochrone(
geometry=feature["geometry"]["coordinates"],
geometry=[feature["geometry"]["coordinates"]],
interval=intervals[idx],
center=locations,
)
Expand Down