GPS or triangulation when setting user position on map? - iphone

I have been programming an app using the mapkit and the SDK 3.0. Everything works allright except for one detail. I have noticed that when displaying the userlocation I get different user positions on the map dependent of the current network. I have read about this problem and understand that it is common? In my WLAN is the user position correctly displayed. When using the 3G net (T-mobile) the position is some 100 meters away from my actual position. I understand this has to do with the celluar phone net using triangulation and in WLAN is the GPS or WiFi hotspot used. So, to my question. Is there a way to go around this? My app shows positions in a town and also the distance to those positions. It is very obvious and also missleading if the position is false because of the short distances. Is there a way (in code) to set which method to be used for getting the user postion? I have tested all other apps on my iPhone using maps and the problem seem to be the same by all of them. (If someone wants to test my app it is in the app store for free under car2go also other comments are of course interesting)
Thanks in advance!
-loop-

Core Location provides information about the vertical and horizontal accuracy of the location that it is reporting. One should use that accuracy to report to the user if the location is suspect. Google maps does this by increasing the size of the blue circle around the location marker. There are other ways to indicate to the user that the location is suspect, alert boxes, not showing the location if it falls outside of some predetermined accuracy, etc.
See: http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html#//apple_ref/occ/instp/CLLocation/horizontalAccuracy

Use an alternate source for your location? Portable GPS units would do the trick.
The real question is how can you correct the data being specified by the 3G triangulation. I wonder if you can do a differential to correct for the 3G's location errors.
1) In a given city, calibrate the 3G location errors by plotting the city. This could be corrected by the 3G networks at any time, so you'd have to have a way to verify and re-calibrate.
2) Calibrate the 3G network's location using a known location - a 3G location along with a GPS location. Take that as a differential that can be applied to other 3G locations. This assumes a consistent offset in the triangulation calculation which probably isn't the reality.
3) Wait for the 3G networks to fix it and do nothing in the meantime.
4) Provide the 3G network provider with error information in their triangulation and see if it is a priority for them.
I can't think of any other viable options...

Perhaps you can use CoreLocation directly. CLLocationManager gives you CLLocation objects than include their accuracy. If you get an accuracy below 50 meters, it the location probably came from GPS.

Related

Is there a way to know which direction one iPhone is from another?

Presume I have two+ iPhones connected to the same server.
Using the sensors built in the iPhone and any possible calculations based on their information, is there any way to tell which direction one phone is from another?
They would be in the same room, so the fluctuation of GPS would not work very well here.
I've tried to model two points on a graph using only their compass readings, but I do not think this will work alone. I could be wrong though.
You could setup a calibration phase in your program where you start each phone in an exact position, and then using the 6 axis motion continually calculate the exact current position (in all 6 axis). But the longer you run that calculation the further from true position you will be and eventually (given a long enough time) one phone could think it's in canada and the other in Mexico.
So It could work for short term spurts if you do a calibration every time you want to start.
There is also the possibility of bluetooth localization, but that would require at least 3 phones and the sharing of positional data between them. Or you could do wifi location, but that would require the same as the bluetooth.
Long story short if you want inches localization it's not going to happen. If you want yards localization it's possible, but not as usable.
As you already mentioned, GPS does not work very well when used inside buildings. Thus, it is not possible to get the direction, as you don't have two reliable positions.
Indoor localisation should be much easier with iOS7 and location beacons .. but this does not help much now.

iphone gps accuracy, can it trigger an event based on location?

I have an issue that i am having trouble to solve. We are about to develop an iphone locative application that would take you around the city with audio that would be played based on the location. I was wondering, do you know how accurate the iphone GPS will be? In terms of actual distance. I am reading 250 m on line but it looks a lot. Plus the gps in the iphone finds my location more precisley than 250 m. I know it is a generic question, but mabe you guys can give me a feedback about it, i am quite desperate and exausted. what we would live to do is, every 70-80 m, put a pin on a map with an audio file, when the user crossed the pin it would trigger an event that is the audio file. I just would love to know how accurate the gps could be so that i can start designing the experience.
Thanks a lot
I've seen iPhone's GPS as accurate as 3m (at least that's what it said on my device when testing).
There is also a new API since iOS 4.0 that you might be interested in that will enable you to set a region for the device to monitor and it will automatically generate a callback when the user crosses the virtual fenceline depending on how accurate you need that to be. This is particularly useful when the app is sent to the background since you can simply monitor the user's location using CLLocation when the app is in the foreground:
- (void)startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy
You can get up to 5 meters accuracy. Within the core location framework there is a property - horizontalAccurracy - that you can read at runtime to get the accuracy for a given moment
The accuracy is anywhere from 5-25m.

current location without using gps

hai
Can we know current location without using gps? Is it possible?
The iPhone SDK has a framework that automatically utilizes the proper mechanism for determining location based on how accurate the result needs to be. Apple has a good article discussing these different methods of locating a device.
Also, here is a good starting point for learning about programming with Location Services.
Furthermore, you can dive right into the CoreLocation framework documentation and learn about everything you can do using Location Services on iOS.
Yes, CoreLocation can triangulate your position via nearby cell phone towers, but the position won't be as accurate as with GPS. Also, it can get your location via nearby WLANs, but this is even less reliable.
Core Location does what you want (by using Wi-Fi triangulation). Check out the documentation of CLLocationManager
Try this
map.showsUserLocation = YES;
map is my MKMapView Object.
Well thats kind of a very broad and very general question. If you are talking cell phones you can use three tower triangulation which is good when you are hitting three towers all at once, but if you are only hitting one the error can be up to a few kilometers.
Now if you are talking internet accessing devices (ie something with an IP address) again things get dicey. If you are using a stationary access point you will get a close approximation using nearest known Hubs with the IP range the device is in. Mobile devices with IPs are really hard to pinpoint.
More links
http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial
http://www.icodeblog.com/2009/12/22/introduction-to-mapkit-in-iphone-os-3-0-part-2/
and step by step guide.
http://gigaom.com/apple/iphone-dev-sessions-finding-your-way-with-mapkit/
To add to #Jenifer's answer
showsUserLocation
Discussion
This property does not indicate
whether the user’s position is
actually visible on the map, only
whether the map view is allowed to
display it. To determine whether the
user’s position is visible, use the
userLocationVisible property. The
default value of this property is NO.
Setting this property to YES causes
the map view to use the Core Location
framework to find the current
location. As long as this property is
YES, the map view continues to track
the user’s location and update it
periodically.
Core Location Framework
The Core Location framework lets you
determine the current location or
heading associated with a device. The
framework uses the available hardware
to determine the user’s position and
heading. You use the classes and
protocols in this framework to
configure and schedule the delivery of
location and heading events. You can
also use it to define geographic
regions and monitor when the user
crosses the boundaries of those
regions.
If you want to know How does the Core Location do this
It actually uses several mechanisms.
GPS
Cell Tower Triangulation
Wifi Hotspot cataloging
Randomly assuming you are in Cupertino
There are tradeoffs based on speed, precision, and available hardware. A first Gen iPad will only have the 3 option available while the iPhone simulator makes use of the last mechanism.
You can observe the difference in these systems in the map application where it initially guesses based on the cell tower, then refines the guess via GPS.
Only options #3 requires a data connection.
And for the humor impaired including #4 was not totally serious although it is functionally correct. (I think they simulate the GPS reporting that location rather than just hard coding it, but I haven't checked.)
From How does CoreLocation locate the device?
The iPod Touch does something like this. It doesn't have a GPS chip, but instead uses the available WiFi networks in the area to get a rough idea of where you're located.

best method to find location in indoors iphone

I am trying to find the location of user using corelocation framework in my app ,
but
it doesn't showing good results , can anyone please tell me how can i get location accurately in indoors ?
thanks in advance
regards
I am not sure, about the exact physical environment but if wifi access points are available then you can use sdk available from skyhook wireless or navision to locate your current position in case the accuracy of the gps position is not good.
This is not a failsafe approach, but may work better in areas where data is available about wireless ap.
In the general case, you can't get an accurate location indoors using Core Location. (What's wrong with your question is in assuming that you can, before asking how to do the impossible.)
You might get lucky if you are under to a tent roof that is paper thin or near a large window below lots of wide open sky, or happen to be between 3 or more nearby wifi access points whose locations are all accurately and precisely registered with whichever wifi database(s) Apple is using.

Typical time and horizontalAccuracy of iPhone CLLocation in practice

I'm wondering if anybody has done thorough empirical testing of the iPhone's ability to find its location. Obviously the performance and accuracy will depend on the type of area one is in (urban vs suburban vs remote).
Just testing from the Simulator, I get a horizontalAccuracy of < 100 meters (98 meters) in a few seconds. I believe it is because it's using WiFi.
But, for user experience purposes, how fast would it be to get this kind of accuracy using EDGE or GPS (assuming both are available)? Does the timing vary in very dense urban areas vs suburban?
It would be great it there were some empirical results published on this so that apps could modify their user experience accordingly.
The simulator just sends one event with the coordinates of Apple's headquarters after a few minutes delay.
There is a difference in accuracy between models of iPhone, in whether "real" GPS, or wifi triangulation, or cell tower location are being used, as well as issues from sky coverage and the particular satellites in view when GPS is being used, as well as how long you wait.
In practice, the range I've seen is from infinite (or maybe the diameter of the planet) when I'm in an elevator (Faraday cage), to telling me when I walk from the front to the back of my car.