Gathering location data (GPS)

macrumors 68000

I am trying to gather location data via GPS only (making this a iPhone 3G only app) but am running into trouble with it. I am trying to get the actual longitude and latitude of the device, then store that information into one of two sets of variables. latCurrent / longCurrent and latPrevious / longPrevious.

macrumors 604

Not an answer, but why GPS only? Seems to me that the location being provided is not necessarily being tagged as to method of generation (meaning that the location data output is hardware-ignorant), and I doubt you'll be able to tap into the GPS receiver at the hardware level. (I admit total ignorance as to how Apple makes this available, and whether any of the above is valid).

As the 1st Gen iPhone also uses location-based services and features as part of the 2.0 firmware--the only difference being the relative accuracy--I wonder why you'd try to limit this to 3G phones only.

thread startermacrumors 68000

Not an answer, but why GPS only? Seems to me that the location being provided is not necessarily being tagged as to method of generation (meaning that the location data output is hardware-ignorant), and I doubt you'll be able to tap into the GPS receiver at the hardware level. (I admit total ignorance as to how Apple makes this available, and whether any of the above is valid).

As the 1st Gen iPhone also uses location-based services and features as part of the 2.0 firmware--the only difference being the relative accuracy--I wonder why you'd try to limit this to 3G phones only.

Click to expand...

Because I am trying to get a very accurate location, so that I can find the distance between two points (within .01mi)

macrumors newbie

i'm looking for the same thing for a personal app for some scientific testing i'm doing (with no budget).. i'm looking to track location over time as accurately and as often as possible within a 250km^2 area. I am not sure regular GPS is accurate enough (10m) for my purposes, so I think I'm screwed anyway, but figured i'd try.

any low level functions i can get at here? or a way to update the GPS update frequency? maybe if i go into Airplane Mode, will cell/wifi be disabled and therefore only give me GPS (or is that disabled too in Airplane mode)? i'd rather not go this way because i was thinking of transmitting data off the iPhone over 3G or WiFi every so often for monitoring.

macrumors 603

GPS accuracy will vary. Even the dedicated Garmin GPS units will lose lock on enough satellites (when under heavy trees, near tall buildings, etc.), and thus produce lower accuracy. The signals themselves will change (the satellites are moving pretty fast, even if you're not). I had a handheld GPS which said my porch was moving up and down 10M every now and then. Another which said I was weaving back and forth across an 8 lane highway.

Best bet for accurate distance measurement is to use two iPhone 3G's, hold them both still until the accuracy goes up, time stamp the measurements, and then compare and subtract just those measurement pairs with similar accuracy and time stamps.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.