Calculating Distance Between two GPS points

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Calculating Distance Between two GPS points

Postby wedtm » Fri Nov 21, 2008 6:59 am

I have a simple GPS tracking application that I'm writing that uploads the GPS data to a server so we can track where our employee's go. However, when the application is running it hammers our server tremendously, and we'd like to limit that.

What I'm looking for is two-fold:

One, a way to determine if the new location is within x meters of the previous location.

Two, a way to determine velocity (speed) and to limit the update if the velocity is under x mph.

Thank you in advance for your help!
wedtm
Freshman
Freshman
 
Posts: 2
Joined: Fri Nov 21, 2008 6:52 am

Top

Postby MrSnowflake » Fri Nov 21, 2008 8:40 am

requestLocationUpdates(String provider, long minTime, float minDistance, LocationListener listener)
minDistance should do the trick. For speed, I don't know, you probably have to calculate it yourself.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby dmt » Thu Jan 08, 2009 2:25 am

Someone else on this forum had a similar question(distance computation).
See my reply to him here : http://www.anddev.org/distance_between_ ... t4195.html

Computing the speed is straightforward: you know your sampling frequency, and you now know the distance between the most recent two points, so, employee speed = distance / sampling interval
User avatar
dmt
Junior Developer
Junior Developer
 
Posts: 15
Joined: Mon Jan 05, 2009 6:06 am

Top

Return to Map Problems

Who is online

Users browsing this forum: Google [Bot] and 2 guests