Yes, but the accuracy would be terrible. GPS positions sometimes fluctuate by hundreds of feet, even if you are standing still. On the other hand, velocity as computed from GPS signals is accurate to within 1/10 mph.
Then why don't you just calculate the velocity then?
Velocity = distance (in a certain direction) / time.
GPS chips do not compute speed by dividing distance by time. As I mentioned earlier, that would be too imprecise, given that positions (and hence distances) fluctuate quite a bit. Instead, they measure Doppler shift in signals received from GPS satellites. Because positions and speeds of satellites are known to a very high precision, the speed of the receiver can also be computed very accurately, down to a fraction of mph.
.
If the GPS can calculate speed/heading for you with greater accuracy than you can do it using position information, then why can't the GPS use this information to improve the accuracy of that position information?
Checking the actual CoreLocation module shows that there are heading and speed attributes present in CLLocation, they just aren't defined in the header. Give them a try:
316ae740 t -[CLLocation altitude]
316ae814 t -[CLLocation clientLocation]
316ae6fc t -[CLLocation coordinate]
316ae59c t -[CLLocation copyWithZone:]
316ae8a8 t -[CLLocation course]
316ae53c t -[CLLocation dealloc]
316ae608 t -[CLLocation description]
316ae36c t -[CLLocation encodeWithCoder:]
316ae8d4 t -[CLLocation getDistanceFrom:]
316ae850 t -[CLLocation heading]
316ae76c t -[CLLocation horizontalAccuracy]
316ae104 t -[CLLocation initWithClientLocation:]
316ae1dc t -[CLLocation initWithCoder:]
316adff8 t -[CLLocation initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:timestamp:]
316adf54 t -[CLLocation initWithLatitude:longitude:]
316ae87c t -[CLLocation speed]
316ae7c4 t -[CLLocation timestamp]
316ae798 t -[CLLocation verticalAccuracy]
316adef8 t -[CLLocationInternal copyWithZone:]
316ade80 t -[CLLocationInternal initWithClientLocation:]
316af234 t -[CLLocationManager bestAccuracy]
316aeb5c t -[CLLocationManager dealloc]
316aebe0 t -[CLLocationManager delegate]
316aee6c t -[CLLocationManager desiredAccuracy]
316aed24 t -[CLLocationManager distanceFilter]
316aead4 t -[CLLocationManager init]
316af2ac t -[CLLocationManager internalClient]
316af054 t -[CLLocationManager locationServicesApproved]
316af020 t -[CLLocationManager locationServicesEnabled]
316aee94 t -[CLLocationManager location]
316af4f4 t -[CLLocationManager onClientEvent:supportInfo:]
316af538 t -[CLLocationManager onClientEventLocation:]
316af9f0 t -[CLLocationManager onClientEventRegistered:]
316aebbc t -[CLLocationManager setDelegate:]
316aed4c t -[CLLocationManager setDesiredAccuracy:]
316aec04 t -[CLLocationManager setDistanceFilter:]
316af088 t -[CLLocationManager setSupportInfo:]
316af2d0 t -[CLLocationManager startUpdatingLocation]
316af3f8 t -[CLLocationManager stopUpdatingLocation]
316af1fc t -[CLLocationManager supportInfo]
316aea70 t -[CLLocationManagerInternal dealloc]
316ae960 t -[CLLocationManagerInternal initWithInfo:]
Thank you! Will give it a try and report back. Just curious, how do you dump this data from a module?
GPS chips do not compute speed by dividing distance by time. As I mentioned earlier, that would be too imprecise, given that positions (and hence distances) fluctuate quite a bit. Instead, they measure Doppler shift in signals received from GPS satellites. Because positions and speeds of satellites are known to a very high precision, the speed of the receiver can also be computed very accurately, down to a fraction of mph.
All other GPS-enabled phones (e.g. BlackBerries or N-series Nokias) expose both speed and direction through APIs. The fact that Apple left these out from the iPhone is a glaring omission, one that I hope they will correct in a future release.
For Doppler shift to mean anything the object would have to be traveling towards or away from the satelite. Unless it is tracking the speed of a rocket heading right for it, there is no way that a GPS satelite could use Doppler shift for speed. GPS disance is accurate to within meters. Stop being a lazy arse and write a program to calculate it. I will give you a hint - divide the distance in miles by the time difference in hours and you will get mph.
i am not talking about doppler or other crazy stuff here,
just basic psysics with the universal speed = distance / time
nonnus
For Doppler shift to mean anything the object would have to be traveling towards or away from the satelite. Unless it is tracking the speed of a rocket heading right for it, there is no way that a GPS satelite could use Doppler shift for speed. GPS disance is accurate to within meters. Stop being a lazy arse and write a program to calculate it. I will give you a hint - divide the distance in miles by the time difference in hours and you will get mph.
Guess what -- GPS satellites do move relative to the ground, as they are not geostationary. The distance between the receiver and satellites constantly changes, which means that there is measurable doppler shift (any relative velocity = doppler shift).
Computing distance / time can work but is very imprecise. GPS positions are accurate to within a few meters _on average_, but there is significant variation. Occasionally, my iphone 3g will move my position on Google Maps by a hundred feet or so, even though I am stationary. 100 ft / sec = 70 mph. I am looking for a bit more precision.
GPS chips do not compute speed by dividing distance by time. As I mentioned earlier, that would be too imprecise, given that positions (and hence distances) fluctuate quite a bit. Instead, they measure Doppler shift in signals received from GPS satellites. Because positions and speeds of satellites are known to a very high precision, the speed of the receiver can also be computed very accurately, down to a fraction of mph.