Send feedback
DistanceLimit
Stay organized with collections
Save and categorize content based on your preferences.
A limit defining a maximum distance which can be traveled. It can be either hard or soft.
If a soft limit is defined, both softMaxMeters
and costPerKilometerAboveSoftMax
must be defined and be nonnegative.
JSON representation
{
"maxMeters" : string ,
"softMaxMeters" : string ,
"costPerKilometerBelowSoftMax" : number ,
"costPerKilometerAboveSoftMax" : number
}
Fields
maxMeters
string (int64 format)
A hard limit constraining the distance to be at most maxMeters. The limit must be nonnegative.
softMaxMeters
string (int64 format)
A soft limit not enforcing a maximum distance limit, but when violated results in a cost which adds up to other costs defined in the model, with the same unit.
If defined softMaxMeters must be less than maxMeters and must be nonnegative.
costPerKilometerBelowSoftMax
number
Cost per kilometer incurred, increasing up to softMaxMeters
, with formula:
min(distanceMeters, softMaxMeters) / 1000.0 *
costPerKilometerBelowSoftMax.
This cost is not supported in routeDistanceLimit
.
costPerKilometerAboveSoftMax
number
Cost per kilometer incurred if distance is above softMaxMeters
limit. The additional cost is 0 if the distance is under the limit, otherwise the formula used to compute the cost is the following:
(distanceMeters - softMaxMeters) / 1000.0 *
costPerKilometerAboveSoftMax.
The cost must be nonnegative.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-09-10 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2023-09-10 UTC."}