Swift LocationManager Horizontal Accuracy - ios

Is it possible to get location manager to register changes in location of a foot or less? I'd like to tap a button and register one location and move a short distance (foot or less) and tap another button to register that location. I'm trying now with the 13 decimal places provided but I see no difference. When I check the horizontal accuracy I'm only getting 65 meters. I'm indoors. New to this.

Related

iOS core location heading and course changing

I am working on an app in which I show the location and direction a plane is heading when flying. I also want to then show labels of the cities one is flying by using augmented reality. I have everything set up and it was working ok when sitting still or driving in a car but when I used it on a plane something weird happened.
When sitting at the gate with the door open or closed the heading of the location icon shows the correct direction when the device is in landscape mode (home button to right). If I rotate the device to the right the plane icon rotates to the right the appropriate amount. Same with left. This is important because when I rotate the phone to the right or left and open the camera for augmented reality the correct cities show up in the correct place. This works completely fine even when we are taxiing on the runway.
However when we take off the function changes. Now no matter what way I change the rotation of the device the plane icon always points in the direction the plane is moving.
I am trying to figure out why this happens and was wondering if this is because at the slower speed sitting still or taxiing core location is using HEADING whereas when we take off enough information is being gather to use COURSE information.
I don't thing this is happening because I am in a faraday cage because it wouldn't work when at the gate or taxiing.
If it is in fact using Heading/Course information how do I compensate so the city labels are where they are supposed to be instead of constantly moving to the front of the plane?
am getting the user latitude, longitude and altitude and the correct heading to the cities so all that is working fine. It is just heading/course problem.
Here is some code just to show I have these things going.
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
locationManager.distanceFilter = kCLDistanceFilterNone;
[locationManager startUpdatingLocation];
[locationManager startUpdatingHeading];
Can I use gyroscope to tell what direction the phone is pointing and add it to the heading/course to get the labels in the correct place if the speed is above a certain amount?
Has anyone ran into the problem and solved it?
This is all well documented by Apple. The location manager uses your direction of motion to determine heading, and ignores phone attitude, if you are moving quickly. If you want the phone attitude independently you must use Core Motion instead.

How to determine if user is on same road as GPS coordinates

I have an GPS based iPhone application that uses Google Maps. The app simply displayes the users current location on the map and will alert users when they come to within a certain radius of a marked Point on their journey.
For legal reasons I am unable to use turn-by-turn navigation in the app so the app will never know the route the user is taking to get from A to B. All the app does is constantly check current location agains a database of GPS Point coordinates. If the users current location is within e.g. 50 meters of a Point, the user will get a message regarding that Point.
My issue is this:
Each Point has a radius of say 50 meters around it as marked by the large blue circle on the image below.
The user is indicated by small blue dot and the direction of travel is marked by the red arrow. In the image the user has entered the radius of the Point but is not actually on the same road as the Point. The user should only get messages should they be on the same road as the Point and within the radius of the Point.
Is there a way I can determine if the user is on the same road as thePoint when entering that Points radius?
Side Note: The app is working in its current state and I can get messages when entering the radius of a Point.
I have been implementing gps based track and trace apps for a while. The easiest way I see is when you get the event that the point is entering the 50 m radius you do a geolookup meaning you ask the system the address of the long/lat. You compare this (street) with the geolookup of your ref point.
This requires a geolookup service and the user being online.
Instead of using a circle, you should use a rectangle defined when creating each point. Or use both: test rectangle of the street once inside the circle if your rectangle is too approximate. You can find out approximate edges of the rectangle by testing geolookup different point of the circles at the beginning.

Can a map overlay be moved?

I'm displaying several user's locations on a map simultaneously as circles of different colors.
I can do this using an annotation and then when the user's location updates use UIView:animateWithDuration: to move to their new location.
However there is a requirement that the size of the circles reflects the accuracy of the location i.e. very accurate equals a circle of size 10 meters, rough accuracy is represented as a circle of size 500 meters etc.
However there are two problems using annotations for this - the first is how to transform meters into a CGRect on the correct size to draw on the map. And the second is the annotations need to be resized if the user zooms the map.
So I was looking at using an overlay instead as that already has a radius and automatic resizing during zooming built in so it handles those two problems.
However it looks like overlays are meant to be static and their coordinate property is read only.
Is there some way I can make the overlays move as the user's location moves? (other than completely remove it and re-add it?)
[THis is for iOS 7 only]

Is There A Way To Get Street View Coordinates After Gesture?

I'm displaying a Street View (GMSPanoramaView) via Google Maps SDK for iOS in an iPhone/iPad app and I need to get the final position of a Street View after the user has navigated around in it using gestures, so that I can restore it to the exact position the user moved it to. This is extremely important to be able to do since the Street View is not accurate and often places an address hundreds of yards away from the actual one requested, forcing the user to tap and zoom to move the Street View in front of it. I don't see any delegate methods or API's to get updated coordinates. I can easily track the heading, pitch, zoom, and FOV via the GMSPanoramaViewDelegate didMoveCamera method, but that does not give me updated coordinates. Thus when I restore the Street View using the last heading, pitch, zoom, and FOV values, the Street View displays at the original location but with the heading, pitch, zoom, and FOV applied, which doesn't display the same position as the user expects. Does anyone know how to get (or track) these coordinates? Thanks!
Implement the panoramaView:(GMSPanoramaView*)view didMoveToPanorama:(GMSPanaorama*)panorama on the delegate.
On the GMSPanorama there's a CLLocationCoordinate2d called coordinate - voila.
EDIT
It also appears that at any point in time to can just get the panorama property from the GMSPanoramaView and get the coordinate from there.

Calculate distance from movement iOS MapKit

I would like to be able to calculate distance based upon movement, as in user taps a start button and then when they reach their destination they tap a stop button. The app would calculate the actual distance travelled between the two points.
I have the mapkit working in that I can get the start location and the map tracks movement I just need to add in the calculation of distance.
Is this possible? If so any sample code would be much appreciated.
well what you could do is, record the user's coordinates when he hits start. The record his coordinates when he hits stop. Then you could use the CoreLocation framework to calculate the distance between the two points.
distance = [newLocation distanceFromLocation:oldLocation];
EDIT
I see now that you want the distance actually travelled by the person. I know that in the new IOS you can make use of the direction functionality, so what you could do is record the distance traveled every time the user changes the direction, and then add everything up when they hit STOP
EDIT
you can check out some of apple's sample code

Resources