From c19216eb77366a96c76beeb76b3ba5124fe596d4 Mon Sep 17 00:00:00 2001 From: Jovillios Date: Mon, 29 Apr 2024 22:37:38 +0200 Subject: [PATCH] add google directions using address string --- routingpy/routers/google.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routingpy/routers/google.py b/routingpy/routers/google.py index 07e2c2f..c70572c 100644 --- a/routingpy/routers/google.py +++ b/routingpy/routers/google.py @@ -262,11 +262,15 @@ def directions( # noqa: C901 origin, destination = locations[0], locations[-1] if isinstance(origin, (list, tuple)): params["origin"] = convert.delimit_list(list(reversed(origin))) + elif isinstance(origin, str): + params["origin"] = origin elif isinstance(origin, self.WayPoint): raise TypeError("The first and last locations must be list/tuple of [lon, lat]") if isinstance(destination, (list, tuple)): params["destination"] = convert.delimit_list(list(reversed(destination))) + elif isinstance(destination, str): + params["destination"] = destination elif isinstance(origin, self.WayPoint): raise TypeError("The first and last locations must be list/tuple of [lon, lat]")