sdk-routing / com.tomtom.online.sdk.routing.data / RouteQueryBuilder

RouteQueryBuilder

@DeprecatedSince("2020.06", "RouteSpecification.Builder") class RouteQueryBuilder : IRouteQuery
Deprecated: Deprecated in favour of RouteSpecification

The default implementation of the RouteQuery object which is used to prepare the query for the Routing API.

Constructors

<init>

RouteQueryBuilder(origPosition: LatLng, destPosition: LatLng)

The default implementation of the RouteQuery object which is used to prepare the query for the Routing API.

Functions

build

fun build(): RouteQuery

Creates new instance of RouteQuery.

withAccelerationEfficiency

fun withAccelerationEfficiency(accelerationEfficiency: Double): RouteQueryBuilder

Specifies the efficiency of converting kinetic energy to saved (not consumed) fuel when the vehicle decelerates (i.e. ChemicalEnergySaved/KineticEnergyLost). ChemicalEnergySaved is obtained by converting saved (not consumed) fuel to energy using fuelEnergyDensityInMJoulesPerLiter. Applicable only for combustion engines. If used at all, must be used in conjunction with .withAccelerationEfficiency. If used, .withVehicleWeightInKg has to be used as well.

withAdrTunnelRestrictionCode

fun withAdrTunnelRestrictionCode(adrTunnelRestrictionCode: AdrTunnelRestrictionCode?): RouteQueryBuilder

If vehicleAdrTunnelRestrictionCode is specified, the vehicle is subject to ADR tunnel restrictions.

withAllowVignette

fun withAllowVignette(allowVignette: String): RouteQueryBuilder

A 3-character ISO 3166-1 alpha-3 country code of a country in which all toll roads with vignettes are allowed.

withAllowVignettes

fun withAllowVignettes(allowVignettes: MutableList<String>): RouteQueryBuilder

A list of 3-character ISO 3166-1 alpha-3 country codes of countries in which all toll roads with vignettes are allowed.

withAlternativeType

fun withAlternativeType(alternativeType: AlternativeType): RouteQueryBuilder

Controls the optimality with respect to the given planning criteria of the calculated alternatives compared to the reference route.

withArriveAt

fun withArriveAt(arriveAt: Date): RouteQueryBuilder

Specifies the desired arrival time for the route to calculation.

withAuxiliaryPowerInKW

fun withAuxiliaryPowerInKW(auxiliaryPowerInKW: Double): RouteQueryBuilder

Specifies the amount of power consumed for sustaining auxiliary systems, in kilowatts (kW). It can be used to specify consumption due to devices and systems such as AC systems, radio, heating, etc. Applicable only for electric engines.

withAuxiliaryPowerInLitersPerHour

fun withAuxiliaryPowerInLitersPerHour(auxiliaryPowerInLitersPerHour: Double): RouteQueryBuilder

Specifies the amount of fuel consumed for sustaining auxiliary systems of the vehicle, in liters per hour. It can be used to specify consumption due to devices and systems such as AC systems, radio, heating, etc. Applicable only for combustion engines.

withAvoidArea

fun withAvoidArea(avoidArea: BoundingBox): RouteQueryBuilder

A rectangle that defines area that will be avoided during route calculation.

withAvoidAreas

fun withAvoidAreas(avoidAreas: MutableList<BoundingBox>): RouteQueryBuilder

A list of rectangles that defines areas that are to be avoided during route calculation.

withAvoidList

fun withAvoidList(avoidList: List<Avoid>?): RouteQueryBuilder

Specifies what the route calculation should try to avoid when determining the route.Can be specified multiple times.

withAvoidType

fun withAvoidType(avoidType: Avoid): RouteQueryBuilder

Specifies what the route calculation should try to avoid when determining the route.Can be specified multiple times.

withAvoidVignette

fun withAvoidVignette(avoidVignette: String): RouteQueryBuilder

A 3-character ISO 3166-1 alpha-3 country code of country in which all toll roads with vignettes are to be avoided.

withAvoidVignettes

fun withAvoidVignettes(avoidVignettes: MutableList<String>): RouteQueryBuilder

A list of 3-character ISO 3166-1 alpha-3 country codes of countries in which all toll roads with vignettes are to be avoided.

withComputeBestOrder

fun withComputeBestOrder(computeBestOrder: Boolean): RouteQueryBuilder

Specifies if the best order of waypoints should be used to compute route. For example, if the maximum allowed number of waypoints is 50, then it might be reduced to 20 in better order.

withComputeTravelTimeFor

fun withComputeTravelTimeFor(computeTravelTimeFor: TravelTimeType): RouteQueryBuilder

Specifies whether to return additional travel times using different types of traffic information (none, historic, live) as well as the default best-estimate travel time.

withConsiderTraffic

fun withConsiderTraffic(considerTraffic: Boolean): RouteQueryBuilder

Specifies if all available traffic information should be considered during routing.

withConstantSpeedConsumptionInKWhPerHundredKm

fun withConstantSpeedConsumptionInKWhPerHundredKm(constantSpeedConsumptionInKWhPerHundredKm: SpeedToConsumptionMap): RouteQueryBuilder

Specifies the speed-dependent component of consumption. Provided as an unordered list of speed/consumption-rate in kWh pairs. Applicable only for electric engines.

withConstantSpeedConsumptionInLitersPerHundredKm

fun withConstantSpeedConsumptionInLitersPerHundredKm(constantSpeedConsumptionInLitersPerHundredKm: SpeedToConsumptionMap): RouteQueryBuilder

Specifies the speed-dependent component of consumption. Provided as an unordered list of speed/consumption-rate in liters-per-100km pairs. Applicable only for combustion engines.

withCurrentChargeInKWh

fun withCurrentChargeInKWh(currentChargeInKWh: Double): RouteQueryBuilder

Specifies the current electric energy supply in kilowatt hours (kWh). Applicable only for electric engines. If used at all, must be used in conjunction with .withMaxChargeInKWh.

withCurrentFuelInLiters

fun withCurrentFuelInLiters(currentFuelInLiters: Double): RouteQueryBuilder

Specifies the current supply of fuel in liters. Applicable only for combustion engines.

withDecelerationEfficiency

fun withDecelerationEfficiency(decelerationEfficiency: Double): RouteQueryBuilder

Specifies the efficiency of converting chemical energy stored in fuel to potential energy when the vehicle gains elevation (i.e. PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed is obtained by converting consumed fuel to chemical energy using fuelEnergyDensityInMJoulesPerLiter. Applicable only for combustion engines. If used at all, must be used in conjunction with .withDownhillEfficiency. If used, .withVehicleWeightInKg has to be used as well.

withDepartAt

fun withDepartAt(departAt: Date): RouteQueryBuilder

Specifies the departure time.

withDownhillEfficiency

fun withDownhillEfficiency(downhillEfficiency: Double): RouteQueryBuilder

Specifies the efficiency of converting potential energy to saved (not consumed) fuel when the vehicle loses elevation (i.e. ChemicalEnergySaved/PotentialEnergyLost). ChemicalEnergySaved is obtained by converting saved (not consumed) fuel to energy using fuelEnergyDensityInMJoulesPerLiter. Applicable only for combustion engines. If used at all, must be used in conjunction with .withUphillEfficiency. If used, .withVehicleWeightInKg has to be used as well.

withFuelEnergyDensityInMJoulesPerLiter

fun withFuelEnergyDensityInMJoulesPerLiter(fuelEnergyDensityInMJoulesPerLiter: Double): RouteQueryBuilder

Specifies the amount of chemical energy stored in one liter of fuel in megajoules (MJ). It is used in conjunction with the *Efficiency parameters for conversions between saved or consumed energy and fuel. For example, energy density is 34.2 MJ/l for gasoline, and 35.8 MJ/l for Diesel fuel. Applicable only for combustion engines.

withHilliness

fun withHilliness(hilliness: Hilliness): RouteQueryBuilder

Specifies the hilliness type for route calculation.

withInstructionsType

fun withInstructionsType(instructionsType: InstructionsType): RouteQueryBuilder

Specifies the instructions type for the route calculation.

withLanguage

fun withLanguage(language: String): RouteQueryBuilder

Specifies the language used for route calculation.

withMaxAlternatives

fun withMaxAlternatives(maxAlternatives: Int): RouteQueryBuilder

Specifies the maximal number of route alternatives to be calculated by the service.

withMaxChargeInKWh

fun withMaxChargeInKWh(maxChargeInKWh: Double): RouteQueryBuilder

Specifies the capacity of the vehicle's battery in kilowatt hours (kWh). Applicable only for electric engines. If used at all, must be used in conjunction with .withCurrentChargeInKWh.

withMinDeviationDistance

fun withMinDeviationDistance(minDeviationDistance: Int): RouteQueryBuilder

All alternative routes returned will follow the reference route from the origin point of the calculateRoute Request for at least this number of meters. This can only be used when reconstructing a route. The minDeviationDistance parameter cannot be used in conjunction with arriveAt.

withMinDeviationTime

fun withMinDeviationTime(minDeviationTime: Int): RouteQueryBuilder

All alternative routes returned will follow the reference route from the origin point of the calculateRoute Request for at least this number of seconds. This can only be used when reconstructing a route. The minDeviationTime parameter cannot be used in conjunction with arriveAt.

withReport

fun withReport(report: Report): RouteQueryBuilder

Specifies if the report should be provided in the route query Response.

withRouteRepresentation

fun withRouteRepresentation(routeRepresentation: RouteRepresentation): RouteQueryBuilder

Specifies the route representation for the route calculation.

withRouteType

fun withRouteType(routeType: RouteType): RouteQueryBuilder

Specifies the route type.

withSectionType

fun withSectionType(sectionType: SectionType): RouteQueryBuilder

Specifies which of the section types is reported in the route Response.

withSupportingPoint

fun withSupportingPoint(supportingPoint: LatLng): RouteQueryBuilder

A route point to be used as input for route reconstruction.

withSupportingPoints

fun withSupportingPoints(supportingPoints: MutableList<LatLng>): RouteQueryBuilder

A list of base route points to be used as input for route reconstruction.

withTravelMode

fun withTravelMode(travelMode: TravelMode): RouteQueryBuilder

Specifies the travel mode for route calculation.

withUphillEfficiency

fun withUphillEfficiency(uphillEfficiency: Double): RouteQueryBuilder

Specifies the efficiency of converting chemical energy stored in fuel to potential energy when the vehicle gains elevation (i.e. PotentialEnergyGained/ChemicalEnergyConsumed). ChemicalEnergyConsumed is obtained by converting consumed fuel to chemical energy using fuelEnergyDensityInMJoulesPerLiter. Applicable only for combustion engines. If used at all, must be used in conjunction with .withDownhillEfficiency. If used, .withVehicleWeightInKg has to be used as well.

withVehicleAxleWeightInKg

fun withVehicleAxleWeightInKg(vehicleAxleWeightInKg: Int): RouteQueryBuilder

Specifies the vehicle axle weight for route calculation.

withVehicleCommercial

fun withVehicleCommercial(vehicleCommercial: Boolean): RouteQueryBuilder

Specifies if the vehicle is used for commercial to calculate route.

withVehicleEngineType

fun withVehicleEngineType(vehicleEngineType: VehicleEngineType): RouteQueryBuilder

Specifies the vehicle engine type for route query.

withVehicleHeading

fun withVehicleHeading(vehicleHeading: Int): RouteQueryBuilder

Specifies the vehicle heading for route calculation.

withVehicleHeightInMeters

fun withVehicleHeightInMeters(vehicleHeightInMeters: Double): RouteQueryBuilder

Specifies the vehicle height for route calculation.

withVehicleLengthInMeters

fun withVehicleLengthInMeters(vehicleLengthInMeters: Double): RouteQueryBuilder

Specifies the vehicle length for route calculation.

withVehicleLoadType

fun withVehicleLoadType(vehicleLoadType: VehicleLoadType): RouteQueryBuilder

Specifies the vehicle load type for route calculation.

withVehicleMaxSpeedInKph

fun withVehicleMaxSpeedInKph(vehicleMaxSpeedInKph: Int): RouteQueryBuilder

Specifies the vehicle max speed for route calculation.

withVehicleWeightInKg

fun withVehicleWeightInKg(vehicleWeightInKg: Int): RouteQueryBuilder

Specifies the vehicle weight in kilograms for route calculation.

withVehicleWidthInMeters

fun withVehicleWidthInMeters(vehicleWidthInMeters: Double): RouteQueryBuilder

Specifies the vehicle width for route calculation.

withWayPoints

fun withWayPoints(wayPoints: Array<LatLng>): RouteQueryBuilder

Specifies the array of map coordinates whose geographical information indicates your waypoints for the route calculation.

withWayPointsList

fun withWayPointsList(wayPointsList: List<LatLng>): RouteQueryBuilder

Specifies the array of map coordinate whose geographical information indicates your waypoints for the route calculation.

withWayPointsWithAcc

fun withWayPointsWithAcc(wayPointsWithAcc: List<LatLngAcc>): RouteQueryBuilder

Specifies the array of map coordinate whose geographical information indicates your waypoints with radius for the route calculation.

withWindingness

fun withWindingness(windingness: Windingness): RouteQueryBuilder

Specifies the windingness type for route calculation.

Companion Object Functions

create

fun create(origPosition: LatLng, destPosition: LatLng): RouteQueryBuilder

Creates an instance of RouteQuery with given origin and destination.