0

使用 HERE 公共交通 API V3 搜索具有名称和半径的车站,我通过以下查询获得多达 25 个车站:

https://transit.ls.hereapi.com/v3/stations/by_name.json?
center=50.7374,7.0982&name=berlin&max=25&radius=90000000&apiKey={YOUR_API_KEY}

将相同的查询转换为 HERE 公共交通 API V8(下一行)不会提供任何站点。

https://transit.hereapi.com/v8/stations?
in=50.7374,7.0982&name=berlin&r=90000000&maxPlaces=25&apiKey={YOUR_API_KEY}

在迁移文档中,没有关于此问题的信息。只是提到了一些结果的参数被删除,而不是结果本身。

4

1 回答 1

1

问题是由于在您的公共交通 v8 API 调用中错误地使用了半径。在您的 V8 查询中,您提供了 radius(r) 作为单独的参数,这是不正确的。

请注意,在 V8 中提供半径信息的正确方法是参数 in= {lat},{lng}[;r={radius}],其中默认半径 = 500 米。

您还可以在https://developer.here.com/documentation/public-transit/migration_guide/topics/stations-migration.html中查看文档

以正确的方式提供半径(以下查询)可以获取所需的结果。

https://transit.hereapi.com/v8/stations?in=50.7374,7.0982;r=90000&name=berlin&maxPlaces=25&apiKey={YOUR_API_KEY}
于 2021-01-25T09:15:44.160 回答