Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

: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.
"""
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