Parse tuple point response (v8) and minor fix in HereMapsRoutingIsolineV8 options parameter

This commit is contained in:
Mmoncadaisla 2021-05-17 13:25:54 +02:00
parent 8e6da0b6fa
commit e21d850679
2 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,8 @@ class HereMapsRoutingIsoline(Traceable):
options) options)
def __calculate_isolines(self, source, mode, data_range, range_type, def __calculate_isolines(self, source, mode, data_range, range_type,
options=[]): options=None):
options = [] if options is None else options
parsed_options = self.__parse_options(options) parsed_options = self.__parse_options(options)
source_param = self.__parse_source_param(source, parsed_options) source_param = self.__parse_source_param(source, parsed_options)
mode_param = self.__parse_mode_param(mode, parsed_options) mode_param = self.__parse_mode_param(mode, parsed_options)

View File

@ -11,6 +11,9 @@ def geo_polyline_to_multipolygon(polyline):
else: else:
coordinates = [] coordinates = []
for point in polyline: for point in polyline:
if isinstance(point, tuple):
lat, lon = point
else:
lat, lon = point.split(',') lat, lon = point.split(',')
coordinates.append("%s %s" % (lon, lat)) coordinates.append("%s %s" % (lon, lat))
wkt_coordinates = ','.join(coordinates) wkt_coordinates = ','.join(coordinates)