In my IOS app I worked on the functionality of detect the regions and its working fine whenever user enters in those regions, means didEnterARegion, didExitRegion methods getting called. Now I am facing a problem while enhancing this functionality with one more feature. Lets assume there are two roads i.e Road A and Road B with their lanes direction opposite to each other. When I am plotting the regions for both roads at different different locations on the roads, the condition can arise when the vehicles moving on Road A can detect the plotted region on Road B and vice versa.But I want to prevent the detection of regions plotted on Road A by Road B moving vehicles and vice versa.
It will work fine if my app will detect the regions based on the moving direction of vehicle or device (app knows that regions associated with which direction). I tried lot of solutions for it. But still not able to find the direction of angle of moving vehicle. Please suggest some solutions or algorithms to resolve this problem. Thanks.