SKPOITrackerManager不工作的除外 [英] SKPOITrackerManager not working as excepted

查看:185
本文介绍了SKPOITrackerManager不工作的除外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SKPOITrackerManager 追踪导航模式自定义兴趣点可跟踪。 SKTrackablePOI 对象的ArrayList中具有放在我的路线附近的许多元素。但其中只有一个是由 onReceivedPOIs跟踪()。此方法只返回一个元素列表。但它被称为5至10倍为恰好一个兴趣点。我很抱歉,我不能在这里发布我的完整code,由于项目协议。但在这里我可以告诉你在 SKPOITrackerListener 接口的实现我的设置:

I am using SKPOITrackerManager to track self-defined trackable POIs in navigation mode. The arraylist of SKTrackablePOI objects has many elements which are placed near my route. But only one of them is tracked by onReceivedPOIs(). This method only returns a one-element-list. But it is called 5 to 10 times for exactly one POI. I am sorry that I can not post my complete code here due to project agreement. But here I can show you my settings in an implementation of the SKPOITrackerListener interface:

public void startPOITracking() {
    poiTrackerManager = new SKPOITrackerManager(this);
    SKTrackablePOIRule skTrackablePOIRule = new SKTrackablePOIRule();
    skTrackablePOIRule.setAerialDistance(15000);
    skTrackablePOIRule.setRouteDistance(15000);
    skTrackablePOIRule.setNumberOfTurns(15000);
    skTrackablePOIRule.setMaxGPSAccuracy(15000);
    skTrackablePOIRule.setEliminateIfUTurn(false);
    skTrackablePOIRule.setMinSpeedIgnoreDistanceAfterTurn(12000);
    skTrackablePOIRule.setMaxDistanceAfterTurn(150000);
    poiTrackerManager.startPOITrackerWithRadius(100, 0.5);
    poiTrackerManager.setRuleForPOIType(SKTrackablePOIType.INVALID, skTrackablePOIRule);
    poiTrackerManager.addWarningRulesforPoiType(SKTrackablePOIType.INVALID);
}

我已经设置了limitions非常高的值在 SKTrackablePOIRule 键,依旧是只有一次的POI。我甚至可以注释掉与行poiTrackerManager.setRuleForPOIType(SKTrackablePOIType.INVALID,skTrackablePOIRule); ,我仍然收到只有一个POI。也许有人可以帮助理解我的问题。

I have set the limitions to very high values within SKTrackablePOIRule and still a get only one POI. I can even comment out the line with poiTrackerManager.setRuleForPOIType(SKTrackablePOIType.INVALID, skTrackablePOIRule); and I still receive only one single POI. Maybe someone can help to understand my problem.

推荐答案

下面是我在过去使用:

poiTrackingManager = new SKPOITrackerManager(this);
SKTrackablePOIRule rule = new SKTrackablePOIRule();
rule.setAerialDistance(5000); // this would be our main constraint, stating that all the POIs with 5000m, aerial distance should be detected
rule.setNumberOfTurns(100); // this has to be increased – otherwise some points will be disconsidered
rule.setRouteDistance(10000);//this has to be increased as the real road route will be longer than the aerial distance
rule.setMinSpeedIgnoreDistanceAfterTurn(20); //decrease this to evaluate all candidates
rule.setMaxDistanceAfterTurn(10000); //increase this to make sure we don't exclude any candidates
rule.setEliminateIfUTurn(false); // setting this to true (default) excludes points that require us to make an U-turn to get to them 
rule.setPlayAudioWarning(false);

注意:我不能确定是什么这些参数的最大/最小值,因为我已经看到了一些问题的时候都太高(他们这样做会影响路由算法,更precissely道路图是如何探索所以这可以解释为什么它可能会发生故障的高值) - 我想说的是,你应该观念保守开始,然后逐渐增加它们

Note: I'm not certain what are the max/min values for these parameters as I've seen some issues when they are too high (they do affect the routing algorithm, more precissely how the road graph is explored so this could explain why at high values it might malfunction) - I would say that you should start with conservative values and then gradually increase them

有关startPOITrackerWithRadius,如果你设置半径为100(米)我会用不同的值,这样可大大减少的POI的数量,该SDK能够分析(即使该规则是好,兴趣点可能不会被分析因为他们不会在半径(空中距离)在你的当前位置下跌):

For startPOITrackerWithRadius I would use different values as if you set the radius to 100 (meters) this would greatly reduce the number of POIs that the SDK is able to analyze (even if the rules are good, the POIs might not be analyzed as they don't fall in the "radius" (aerial distance) around your current position) :

poiTrackingManager.startPOITrackerWithRadius(1500, 0.5);

另请参见 http://sdkblog.skobbler.com/detecting -tracking-兴趣点 - 在你的路/ 关于POITraker如何运作的见解。

Also see http://sdkblog.skobbler.com/detecting-tracking-pois-in-your-way/ for more insights on how the POITraker works

这篇关于SKPOITrackerManager不工作的除外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆