View Full Version : Detected POI on route SKTrackablePOIRule

20.02.2015, 20:26

I'm looking for a way to get the POI on the current calculated route.

I found SKTrackablePOIRule to get the POI but I'm not sure what to pass as parameters.

SKTrackablePOIRule(int routeDistance, int aerialDistance, int numberOfTurns, int maxGPSAccuracy, double minSpeedIgnoreDistanceAfterTurn, int maxDistanceAfterTurn, boolean eliminateIfUTurn)

route distance: 2000 -that should give me the POI that are at less than 2000m
aerial distance: 2000 -Since I only want them on the way, it should be the same as route distance?
number of turns: 0? - Is this the parameter that I should set at 0 in order to only have POI on the current route?
max gps accuracy: x - I'm ok with that one
min speed ignore distance after turn: ? - I don't understand that one
max distance after turn: ? - I don't understand that one
eliminate if U turn: true? - I reckon this will remove all POI that requires a U turn (meaning on the other side of the road?)

24.02.2015, 15:09
We've improved the documentation for the POI tracking functionality in the 2.4 release.

In a nutshell - all the rules are used to determine the candidate POI (For detecting a POI all of the below rules should be fulfilled):
route distance: The maximum distance on the route to the SKTrackablePOI, in order to be detected. Default value is 1500m.
aerial distance: The maximum aerial distance to the SKTrackablePOI, in order to be detected. Default value is 3000m.

Route distance calculates a route (real road geometry) to the POI as compares this to the "distance" parameter.
Aerial distance calculates the "aerial distance" - it could be that 2 points are rather close on map, but there "route" between them is rather long (i.e. imagine 2 points separated by a river)

number of turns: The maximum number of turns on the shortest route to the SKTrackablePOI, in order to be detected. Default value is 2.
max gps accuracy: The GPS accuracy threshold above which the SKTrackablePOI will be ignored, in meters. Default is 100 meters.
min speed ignore distance after turn: The speed threshold above which the straight distance to the SKTrackablePOI, after the last turn on the route to it , is ignored. Default value is 80 km/h.
max distance after turn: The distance threshold that eliminates POIs that are far away from the last corner to them. Default value is 300 meters.
eliminate if U turn: If set to YES, the tracker will eliminate SKTrackablePOIs that are placed after an U-turn. Default is YES.

In your case, I would play around with the route distance and number of turns parameter and test the algorithm in simulation to see the results.

As a rule of thumb, if you want that only 1 parameter to determine the outcome, you should provide extreme values for all the other parameters:
route distance: 2000
aerial distance: 10000 (always true)
number of turns: 20 (always true)
max gps accuracy: 1000 (always true - although I would not touch this default value)
min speed ignore distance after turn: 1 (always true) - it indicates the min speed you should be traveling with in order to receive POI detection updates
max distance after turn: 5000 (always true)
eliminate if U turn: true

24.02.2015, 19:54
Thank you for the details!