Here api 这里映射了路由API v8:街道属性

Here api 这里映射了路由API v8:街道属性,here-api,Here Api,我正在请求一条通过这里的路线地图,目前的路线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.

我正在请求一条通过这里的路线地图,目前的路线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'
这将返回包含函数类和道路属性的结果,如下所示:

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

这很好,但是是否有StreetAttribute的可能值列表?我只找到了与某种程度相似的属性,但如果知道streetAttributes返回的值不同,那就太好了。

有文档记录,但您可能会错过它。当转到API引用()时,需要单击打开200OK响应,并且还必须单击响应的每个子键。如果你深入研究,你可以找到我在这里复制的StreetAttribute文档:

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.