0

I am about to make an app where I alert people if another person is within say 150 yrds of another person. I am making the App with Phongegap and have read the docs on the Geo-location and worked through the examples.

I am not looking for a here is your code anwser just some direction on what the best tools to use for this are.

I want to be holding my phone in say a park and when another member comes within 150 yrds I want it to alert me. My difficulty is not getting the location of the individual phone but knowing when one is near another.

My thoughts so far are:

1) get the location of the phones when a change is detected and create a new landmark/ move the lanmark on an API like Google geolocation - Almost dynamic landmarks? Would this work?. Then other user when they check the map can view the landmarks(other people).

2)is there a plugin I can use?

3)Is there clever way of working the distances out - Although comparing those distaces with multiple users could be taxing on the database?

Any guidance is much appreciated on this.

Fintan Creaven
  • 250
  • 2
  • 17

1 Answers1

1

Firstly, you are probably going to need a server. Your app would need to send the server with the current location of then phone. Getting this location is outside my knowledge base. You would also have to store this data for x amount of time (An hour maybe) (On the server).

Once you have this data, you can then do a rough lookup in your storage to find similar Lats and Lons (EG +- 0.1 degrees). This should reduce the amount of results returned. You can then calc the distance between each one and the current location. Once you have the distance you can then filter and return the result.

Hopefully that gives a rough idea of the steps you could use.

tl8
  • 537
  • 5
  • 22
  • Thanks for your comments. I have a server, I can get the long and lats and can get into database I just wondered what the best way of finding out what is close. I found a great set of answers here http://stackoverflow.com/questions/27928/how-do-i-calculate-distance-between-two-latitude-longitude-points. I will however keep the +- degrees and looked up the 6th dec place gives accuracy to 1.3 M so up vote for that – Fintan Creaven May 11 '15 at 01:23