0

I want to put objects in a map and discover which is the closest object from me, supposing that I'm in a moving car with my cell phone. Thus, to define the closest object I need to take the orientation of the movement and the street into account. The following figure illustrate the situation:

enter image description here

So, object 2 is the closest object, but it is not in the same street as I'm (the car). The object 1 is the closest object in the street that I'm , but I'm going to the opposite side. Finnaly, the object 3 is the one I want, since it is the closest object in the same street I'm and also following the orientation of my movement.

Does anybody know how I can obtain the closest object to me (considering that I'm moving) according to the rule I just mentioned?

If you don't know an API, but know what kind of concepts and stuff I need to study would be helpful, because I'm new in android and geographic systems development.

2
  • 1
    you can use Google Places API with the Android Device Orientation stackoverflow.com/questions/25537933/…
    – Mapperz
    Nov 19, 2014 at 20:36
  • Wouldn't "Android Device Orientation" I way to define the orientation (vertical or horizontal) of the cellphone? Does it also work to define the orientation of the movement?
    – csfb
    Nov 19, 2014 at 22:42

1 Answer 1

1

You should work with device sensors to determine device direction for which Android does provide an API as well. You can refer http://developer.android.com/guide/topics/sensors/sensors_overview.html

To calculate the closest object, you will have to make an algorithm which keeps on checking distance between your position and every other object in a given proximity.

Not the answer you're looking for? Browse other questions tagged or ask your own question.