Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
12 changes: 9 additions & 3 deletions routingpy/routers/opentripplanner_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,14 @@ def directions(
) {{
itineraries {{
duration
startTime
endTime
legs {{
startTime
endTime
duration
distance
mode
legGeometry {{
points
}}
Expand Down Expand Up @@ -198,6 +203,7 @@ def _parse_legs(self, legs):
geometry.extend(points)
distance += int(leg["distance"])

geometry = [coord[::-1] for coord in geometry]
return geometry, distance

def isochrones(
Expand Down Expand Up @@ -283,13 +289,13 @@ def raster(
use. Default: "WALK,TRANSIT"
:type profile: str

:time: Departure date and time. The default value is now.
:time: Departure date and time (timezone aware). The default value is now (UTC).
:type time: datetime.datetime

:cutoff: The maximum travel duration in seconds. The default value is one hour.

:arrive_by: Whether the itinerary should depart at the specified time (False), or arrive to
the destination at the specified time (True). Default value: False.
:arrive_by: Set to False when searching from the location and True when searching to the
location. Default value: False.
:type arrive_by: bool

:param dry_run: Print URL and parameters without sending the request.
Expand Down
1 change: 1 addition & 0 deletions routingpy/routers/valhalla.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def parse_direction_json(response, units):
factor = 0.621371 if units == "mi" else 1
distance += int(leg["summary"]["length"] * 1000 * factor)

geometry = [coord[::-1] for coord in geometry]
return Direction(geometry=geometry, duration=int(duration), distance=int(distance), raw=response)

def isochrones( # noqa: C901
Expand Down