-2

My requirement:

Area around the Path(Route) is having some important places(quantity is approx. 50). When user is moving on the path, and reach to the nearest place(e.g. A), I need to perform some task particular to that place(e.g. A).

Currently, I am creating geofences for all the required places at the same time but having doubt about the battery consumption.

Is there any way to minimize the battery consumption? If yes, then please help. Any help or guidance will be well appreciated.

Note: User can enter to the route from start/end/middle of the route.

4

1 回答 1

1

这是一种选择:

  1. 通过算法运行每个点以确定从该点到用户的距离。
      例如假设用户在 X(0),Y(0) 运行 (Xn - X(0)) 2 + (Yn - Y(0)) 2的根

  2. 将距离指定为地理围栏的属性。

  3. 对新属性的地理围栏数组进行排序。

  4. 将 10 个最接近(或根据路径的距离和地理围栏彼此之间的接近程度看似合理的任何数量)区域添加到一个新数组中。

  5. 注册这 10 个(左右)区域。

  6. 记录完成此过程的最后位置,并将其与用户当前位置进行比较。如果用户移动了一定距离,则重新开始该过程。

尤其是使用简单的数学运算符,这在操作系统上比同时搜索 50 个区域要容易得多。

于 2014-06-27T06:37:16.673 回答