android, find the nearest location without going through all the locations

Posted by Marwan on Stack Overflow See other posts from Stack Overflow or by Marwan
Published on 2012-11-30T08:53:03Z Indexed on 2012/12/02 17:05 UTC
Read the original article Hit count: 183

Filed under:
|
|
|
|

I am building a taxi dispatching app
first: I need the passenger app to show the nearest taxis, now I know how to do that in code but in my way I have to go through all the taxis locations(in database on server) and calculate the distance from the passenger location and get the lowest ones - I don't want to do this because there will be a lot of taxis and going through all of them and making some math is kind of pain on the server- is there a way to get the nearest ones without going through all of them?

second: what the best database to use - first, should it be sql or non-sql - I need a very robust database, because there will be a lot of updates (I mean the passengers locations added then deleted when arriving to destination && the taxis location changes frequently)

finally: I will use RubyOnRails to do the server side and json as data transfer format, do you have a recommendation to me on something better?

Thanks

© Stack Overflow or respective owner

Related posts about android

Related posts about Xml