0

Got a big issue that I cant get it right in my head. Tried to read lot's of articles on net, but just culdn't make all pieces together to one clear image what to do.

I have following data:

  1. Locations of bus stations (route is known) in latitude/longitude value pairs.

  2. Location of current station - place where I stand.

  3. GPS data for all vehicles that are operating on this route in GPRMC format: e.g. "$GPRMC,122532.000,A,4533.2553,N,01842.6141,E,28.18,92.86,220113,,,D*66;"

Now the hard part :) - at least for me, what would be logic to find out from GPS data which vehicle will come first to my current location.

My logic was first to get nearest vehicle, but then I realised that it can be vehicle that just passed my location. And this made me sad a lot :)

If someone have piece of code - any language :) it would be great, but also if someone can explain me - or point me to some good article I would be really grateful. I didn't work before with this information so it makes me really confused to get whole picture how it is supposed to work.

4

1 回答 1

0

这并不容易,但是:

你必须

1)计算汽车到当前位置的距离

2) 观察这个距离至少两个或三个测量:如果距离变小,那么汽车正在接近该位置。如果它变得更大,那么汽车正在远离。

3)汽车是最好的,具有“接近”属性并且距离最小。

于 2013-01-31T19:29:28.143 回答