HERE 地图路由 API v8:街道属性

HERE Maps Routing API v8: Street attributes

我正在通过 HERE Maps Routing API v8 请求路线,目前是这样

curl --location --request GET 'https://router.hereapi.com/v8/routes?apiKey={{someapikey}}&return=polyline&spans=functionalClass,streetAttributes&origin=38.577482,-121.858775&destination=38.682991,-121.576498&transportMode=truck'

此 returns 结果包含功能类和道路属性,如下所示:

// ...
"spans": [
    {
        "offset": 0,
        "streetAttributes": [
            "rightDrivingSide"
        ],
        "functionalClass": 4
    },
    {
        "offset": 205,
        "streetAttributes": [
            "rightDrivingSide",
            "dividedRoad"
        ],
        "functionalClass": 1
    }
// ...

这很好,但是有没有 streetAttributes 的可能值列表?我只发现 https://developer.here.com/documentation/android-premium/3.16/api_reference_java/com/here/android/mpa/common/RoadElement.Attribute.html 与某种程度相似,但很高兴知道不同的值 streetAttributes returns.

它被记录在案,但你可能会错过它。当你转到API参考(https://developer.here.com/documentation/routing-api/8.6.4/api-reference-swagger.html)时,你需要点击打开200 OK响应,响应的每个子键也必须点击。如果你向下挖掘,你会看到我在这里复制的 streetAttributes 文档:

StreetAttributes is applied to a span of a route section and describes attribute flags of a street.

rightDrivingSide: Do vehicles have to drive on the right-hand side of the road or the left-hand side.
dirtRoad: This part of the route has an un-paved surface.
tunnel: This part of the route is a tunnel.
bridge: This part of the route is a bridge.
ramp: This part of the route is a ramp (usually connecting to/from/between highways).
motorway: This part of the route is a controlled access road (usually highways).
roundabout: This part of the route is a roundabout.
underConstruction: This part of the route is under construction.
dividedRoad: This part of the route uses a road with a physical or legal divider in the middle.
privateRoad: This part of the route uses a privately owned road.
As it is possible that new street attributes are supported in the future, unknown street attributes should be ignored.