diff --git a/routingpy/routers/google.py b/routingpy/routers/google.py index c27e2c8..d832179 100644 --- a/routingpy/routers/google.py +++ b/routingpy/routers/google.py @@ -369,12 +369,8 @@ def parse_direction_json(response, alternatives): duration += leg["duration"]["value"] distance += leg["distance"]["value"] for step in leg["steps"]: - geometry.extend( - [ - list(reversed(coords)) - for coords in utils.decode_polyline5(step["polyline"]["points"]) - ] - ) + geometry.extend(utils.decode_polyline5(step["polyline"]["points"])) + return Direction(geometry=geometry, duration=duration, distance=distance, raw=response) def isochrones(self): # pragma: no cover diff --git a/routingpy/routers/opentripplanner_v2.py b/routingpy/routers/opentripplanner_v2.py index dd32e05..eb0a5bd 100644 --- a/routingpy/routers/opentripplanner_v2.py +++ b/routingpy/routers/opentripplanner_v2.py @@ -32,7 +32,6 @@ class OpenTripPlannerV2: def __init__( self, - api_key: Optional[str] = None, base_url: Optional[str] = _DEFAULT_BASE_URL, user_agent: Optional[str] = None, timeout: Optional[int] = DEFAULT, @@ -45,8 +44,6 @@ def __init__( """ Initializes an OpenTripPlannerV2 client. - :param api_key: NOT USED, only for compatibility with other providers. - :param base_url: The base URL for the request. Defaults to localhost. Should not have a trailing slash. :type base_url: str @@ -148,9 +145,14 @@ def directions( ) {{ itineraries {{ duration + startTime + endTime legs {{ + startTime + endTime duration distance + mode legGeometry {{ points }} @@ -195,7 +197,7 @@ def _parse_legs(self, legs): geometry = [] for leg in legs: points = utils.decode_polyline5(leg["legGeometry"]["points"]) - geometry.extend(points) + geometry.extend(list(reversed(points))) distance += int(leg["distance"]) return geometry, distance @@ -283,13 +285,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.