是否可以使用 HERE 路由将 Waypoint-ID 添加到 via Waypoints?

Is it possible to add a Waypoint-ID to the via Waypoints using HERE Routing?

我必须计算一些路线,以便将 8 个人乘坐一辆更大的汽车(小巴)带到工作场所,并在下午将他们带回家。是否可以向坐标添加 ID 属性?这将帮助我评估 Java 代码中的响应,而不是检查坐标(“originalLocation”与“location”)。

例如最后的ID 4711,用分号隔开

类似于 Routing V7 中的 UserLabel API:[API V7 航点描述] (https://developer.here.com/documentation/routing/dev_guide/topics/resource-param-type-waypoint.html#resource-param-type-waypoint__navigation-waypoint-link-positions)。那里的描述说:V8 中的航点:string, {lat},{lng}[;name={name}]

我正在使用或试验 HERE Routing API V8。或者我可以在主页上看到的多个 HERE Telematics API 中的某处是否有更多选项?

我尝试了迁移指南 (https://developer.here.com/documentation/routing-api/8.20.1/migration_guide/index.html) 中描述的一些方法,但它们没有用

  1. (a) &via=47.7747679928991,12.322371484945947;名称=3333
    • returns: Invalid place option .... Unexpected input at end of place option at 'name=3333'
  2. (b) &via=47.82695713017682,12.295106144134037!name=3333
    • returns: Invalid waypoint option
  3. (c) &via=47.82695713017682,12.295106144134037;4711
    • returns: Place or waypoint option specification '4711' is invalid
    • ...Invalid value for parameter 'via'

顺便说一句:我知道 API 和

之间有区别

PlaceOptions 似乎是固定的指定参数,例如 course、sideOfStreetHint、stopDuration 等,因此我认为 WaypointOptions 应该是可行的方法。但是还是不行。

你说得对,name 选项似乎已被删除,迁移指南中并未反映这一点。期待得到 HERE 开发人员支持的回应,也许有一个未记录的选项用于标记 waypoints.

根据最新的API documentation (v8.20.1),这些是via参数的所有可用选项:

    A location defining a via waypoint.

    A via waypoint is a location between origin and destination. The route will do a stop
    at the via waypoint.

    Multiple waypoints can also be specified using multiple via parameters like
    `via=...&via=...`, in which case the route will traverse these waypoints sequentially in
    the order specified in the request.

    ## Format

    Format: `Place[WaypointOptions]`

    * Place: `{lat},{lng}[PlaceOptions]`
    * PlaceOptions: `;option1=value1;option2=value2...`
    * WaypointOptions: `!option1=value1!option2=value2...`

    A waypoint consists of:

    * Exactly one place
    * Optional settings for the place
    * Optional settings for the waypoint itself

    Supported place options:

    * `course`: int, degrees clock-wise from north. Indicating desired direction at the place.
      E.g. `90` indicating `east`. Often combined with `radius` and/or `minCourseDistance`
    * `sideOfStreetHint`: `{lat},{lng}`. Indicating the side of the street that should be
      used. E.g. if the location is to the left of the street, the router will prefer using
      that side in case the street has dividers. E.g.
      `52.511496,13.304140;sideOfStreetHint=52.512149,13.304076` indicates that the `north`
      side of the street should be preferred. This option is required, if `matchSideOfStreet`
      is set to `always`.
    * `matchSideOfStreet`: enum `[always, onlyIfDivided]`. Specifies how the location set by
      `sideOfStreetHint` should be handled. Requires `sideOfStreetHint` to be specified as
      well.
      + `always` : Always prefer the given side of street.
      + `onlyIfDivided`: Only prefer using side of street set by `sideOfStreetHint` in case
        the street has dividers. This is the default behavior.
    * `nameHint`: string. Causes the router to look for the place with the most similar name.
      This can e.g. include things like: `North` being used to differentiate between
      interstates `I66 North` and `I66 South`, `Downtown Avenue` being used to correctly
      select a residental street.
    * `radius`: int, meters. Asks the router to consider all places within the given radius as
      potential candidates for route calculation. This can be either because it is not
      important which place is used, or because it is unknown. Radius more than 200meter are
      not supported.
    * `minCourseDistance`: int, meters. Asks the routing service to try find a route that avoids actions for
      the indicated distance. E.g. if the origin is determined by a moving vehicle, the user
      might not have time to react to early actions.

    Supported waypoint options:
    * `stopDuration`: desired duration for the stop, in seconds.
    * `passThrough`: boolean. Asks the router to avoid the following during route calculation:
      + Introducing a stop at the waypoint.
      + Splitting the route into sections.
      + Changing the direction of travel.

      Following scenarios are not supported for `passThrough` parameter:
      + Setting both `stopDuration` to a value greater than 0 and `passThrough=true`.
      + Setting `passThrough=true` for `origin` or `destination` of a route.
      The default value is `false`.

    Notes:

    * Non-structural reserved characters in options' values need to be properly percent-encoded.
      Please refer to the developers' guide for more details.

就是说,我想你拥有标签的唯一方法是以某种方式在你的 Java 代码中为每个航路点分配一个标签。