Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
params["height"] = height
if width is not None:
params["width"] = width
if length is not None:
params["length"] = length
if tunnel_category is not None:
params["tunnelCategory"] = convert._delimit_list(tunnel_category, ',')
if truck_restriction_penalty is not None:
params["truckRestrictionPenalty"] = truck_restriction_penalty
if return_elevation is not None:
params["returnElevation"] = convert._convert_bool(return_elevation)
if consumption_model is not None:
params["consumptionModel"] = consumption_model
if custom_consumption_details is not None:
params["customConsumptionDetails"] = custom_consumption_details
if speed_profile is not None:
params["speedProfile"] = speed_profile
return self._parse_direction_json(
self._request(
convert._delimit_list(["/calculateroute", format], '.'),
get_params=params,
dry_run=dry_run
),
if calc_points is not None:
params.append(("calc_points", convert._convert_bool(calc_points)))
if debug is not None:
params.append(("debug", convert._convert_bool(debug)))
if point_hint is not None:
params.append(("point_hint", convert._convert_bool(point_hint)))
### all below params will only work if ch is disabled
if details is not None:
params.extend([("details", detail) for detail in details])
if ch_disable is not None:
params.append(("ch.disable", convert._convert_bool(ch_disable)))
if weighting is not None:
params.append(("weighting", weighting))
if heading is not None:
params.append(("heading", convert._delimit_list(heading)))
if heading_penalty is not None:
params.append(("heading_penalty", heading_penalty))
if pass_through is not None:
params.append(("pass_through", convert._convert_bool(pass_through)))
if block_area is not None:
params.append(("block_area", block_area))
params["maxNumberOfChanges"] = max_number_of_changes
if avoid_transport_types is not None:
params["avoidTransportTypes"] = convert._delimit_list(avoid_transport_types, ',')
if walk_time_multiplier is not None:
params["walkTimeMultiplier"] = walk_time_multiplier
if walk_speed is not None:
params["walkSpeed"] = walk_speed
if walk_radius is not None:
params["walkRadius"] = walk_radius
if combine_change is not None:
params["combineChange"] = convert._convert_bool(combine_change)
if truck_type is not None:
params["truckType"] = truck_type
if trailers_count is not None:
params["trailersCount"] = trailers_count
if shipped_hazardous_goods is not None:
params["shippedHazardousGoods"] = convert._delimit_list(shipped_hazardous_goods, ',')
if limited_weight is not None:
params["limitedWeight"] = limited_weight
if weight_per_axle is not None:
params["weightPerAxle"] = weight_per_axle
params["alternatives"] = convert._convert_bool(alternatives)
if steps is not None:
params["steps"] = convert._convert_bool(steps)
if continue_straight is not None:
params["continue_straight"] = convert._convert_bool(continue_straight)
if annotations is not None:
params["annotations"] = convert._delimit_list(annotations)
if geometries:
params["geometries"] = geometries
if overview is not None:
params["overview"] = convert._convert_bool(overview)
if exclude is not None:
params['exclude'] = exclude
if approaches:
params['approaches'] = ';' + convert._delimit_list(approaches, ';')
if banner_instructions:
params['banner_instuctions'] = convert._convert_bool(banner_instructions)
if language:
params['language'] = language
if roundabout_exits:
params['roundabout_exits'] = convert._convert_bool(roundabout_exits)
if radiuses:
params["radiuses"] = convert._delimit_list(radiuses, ';')
if bearings:
params["bearings"] = convert._delimit_list(
[convert._delimit_list(pair) for pair in bearings], ';'
)
if alternatives is not None:
params["alternatives"] = convert._convert_bool(alternatives)
if steps is not None:
params["steps"] = convert._convert_bool(steps)
if continue_straight is not None:
params["continue_straight"] = convert._convert_bool(continue_straight)
if annotations is not None:
params["annotations"] = convert._convert_bool(annotations)
if geometries:
params["geometries"] = geometries
if overview is not None:
params["overview"] = convert._convert_bool(overview)
return self._parse_direction_json(
self._request("/route/v1/" + profile + '/' + coords, get_params=params, dry_run=dry_run),
alternatives, geometries
)
"""
params = [('vehicle', profile)]
for coordinate in locations:
coord_latlng = reversed([convert._format_float(f) for f in coordinate])
params.append(("point", ",".join(coord_latlng)))
if self.key is not None:
params.append(("key", self.key))
if format is not None:
params.append(("type", format))
if optimize is not None:
params.append(("optimize", convert._convert_bool(optimize)))
if instructions is not None:
params.append(("instructions", convert._convert_bool(instructions)))
if locale is not None:
params.append(("locale", locale))
if elevation is not None:
params.append(("elevation", convert._convert_bool(elevation)))
if points_encoded is not None:
params.append(("points_encoded", convert._convert_bool(points_encoded)))
if calc_points is not None:
params.append(("calc_points", convert._convert_bool(calc_points)))
for coordinate in locations:
coord_latlng = reversed([convert._format_float(f) for f in coordinate])
params.append(("point", ",".join(coord_latlng)))
if self.key is not None:
params.append(("key", self.key))
if format is not None:
params.append(("type", format))
if optimize is not None:
params.append(("optimize", convert._convert_bool(optimize)))
if instructions is not None:
params.append(("instructions", convert._convert_bool(instructions)))
if locale is not None:
params.append(("locale", locale))
if elevation is not None:
params.append(("elevation", convert._convert_bool(elevation)))
if points_encoded is not None:
params.append(("points_encoded", convert._convert_bool(points_encoded)))
if calc_points is not None:
params.append(("calc_points", convert._convert_bool(calc_points)))
if debug is not None:
params.append(("debug", convert._convert_bool(debug)))
params = dict()
if radiuses:
params["radiuses"] = convert._delimit_list(radiuses, ';')
if bearings:
params["bearings"] = convert._delimit_list(
[convert._delimit_list(pair) for pair in bearings], ';'
)
if alternatives is not None:
params["alternatives"] = convert._convert_bool(alternatives)
if steps is not None:
params["steps"] = convert._convert_bool(steps)
if continue_straight is not None:
params["continue_straight"] = convert._convert_bool(continue_straight)
if annotations is not None:
params["annotations"] = convert._convert_bool(annotations)
if geometries:
params["geometries"] = geometries
if overview is not None:
params["overview"] = convert._convert_bool(overview)
return self._parse_direction_json(
self._request("/route/v1/" + profile + '/' + coords, get_params=params, dry_run=dry_run),
alternatives, geometries
center = [convert._format_float(f) for f in locations]
center.reverse()
params.append(("point", ",".join(center)))
if self.key is not None:
params.append(("key", self.key))
if buckets is not None:
params.append(('buckets', buckets))
if reverse_flow is not None:
params.append(('reverse_flow', convert._convert_bool(reverse_flow)))
if debug is not None:
params.append(('debug', convert._convert_bool(debug)))
return self._parse_isochrone_json(
self._request("/isochrone", get_params=params, dry_run=dry_run), type, intervals[0], buckets,
center
)
params.append(("optimize", convert._convert_bool(optimize)))
if instructions is not None:
params.append(("instructions", convert._convert_bool(instructions)))
if locale is not None:
params.append(("locale", locale))
if elevation is not None:
params.append(("elevation", convert._convert_bool(elevation)))
if points_encoded is not None:
params.append(("points_encoded", convert._convert_bool(points_encoded)))
if calc_points is not None:
params.append(("calc_points", convert._convert_bool(calc_points)))
if debug is not None:
params.append(("debug", convert._convert_bool(debug)))
if point_hint is not None:
params.append(("point_hint", convert._convert_bool(point_hint)))
### all below params will only work if ch is disabled
if details is not None:
params.extend([("details", detail) for detail in details])
if ch_disable is not None:
params.append(("ch.disable", convert._convert_bool(ch_disable)))
if weighting is not None: