routes - GeoJson 导航图在这里
问题描述
我正在 android studio Here Map 中创建一个导航应用程序。我使用 ArcGis 创建了一个包含自定义数据的 GeoJSON 文件。我想知道是否有办法使用此 GeoJSON 文件而不是从 Here Map 驾驶路线获取导航方向?
解决方案
假设问题与提供导航功能的 HERE Android Mobile SDK 有关,则需要使用 CoreRouter 类创建路线。如果有 GeoJSON 文件,则需要对其进行解析并转换为至少 GeoCoordinates,然后将其传递给 CoreRouter -> calculateRoute 函数。
public void calculateRoute(java.util.List<GeoCoordinate> routePoints,
RouteOptions routeOptions,
Router.Listener<java.util.List<RouteResult>,RoutingError> listener)
Invokes an asynchronous route calculation. Upon completion of the request, the Listener will be invoked regardless if the request is completed successfully or not.
Parameters:
routePoints - The list of GeoCoordinate that is used for calculate a route. The list must have at least two items.
routeOptions - The RouteOptions is used for route calculation between points and for route recalculation during navigation mode.
listener - A Listener for the CoreRouter This method returns RoutingError.INVALID_PARAMETERS and a route will not be calculated if calculating a route with RouteOptions.TransportMode.PUBLIC_TRANSPORT This method returns RoutingError.INVALID_PARAMETERS and a route will not be calculated if calculating a route with RouteOptions.TransportMode.TRUCK and routePlan uses any Type other than FASTEST.
推荐阅读
- ruby-on-rails - json 模板中的子节点
- python - 无法导入 ColumnTransfomer (Scikit-Learn) - 导入错误:无法导入名称“Parallel”
- c++ - 在循环中顺序遍历成员变量
- javascript - 为什么一键点击事件会映射到 3 个订阅者的 3 个不同值?
- javascript - 必须为我从 API 中提取的每篇文章创建一个单独的 div
- java - AlarmManager 不触发
- python - Python House Adventure - 如果您已经进入房间一次,如何提供不同的输出
- javascript - 我应该以什么格式存储我只需要“YYYY-MM-DD”部分的日期
- python - pyDES encrypt() 输出无法正确复制
- reactjs - 反应路由器 - 正确使用嵌套路由中的链接