0

Using UIImagePickerController to take a photo using the device camera (NOT picked from the photo library) I'm attempting to then retrieve GPS data. It looks like the data is being written (despite other answers online saying Apple is supposed to strip it out?) however the longitude is never set. I tried multiple attempts and I'm always left with a 0 for longitude.

See below for the output:

"{TIFF}" = {
    DateTime = "2017:08:31 18:17:05";
    Make = Apple;
    Model = "iPhone SE";
    Orientation = 6;
    ResolutionUnit = 2;
    Software = "10.3.3";
    XResolution = 72;
    YResolution = 72;
};
"PixelWidth" = 4032;
"{Exif}" = {
    ApertureValue = "2.275007124536905";
    BrightnessValue = "-1.720482836665409";
    ColorSpace = 1;
    DateTimeDigitized = "2017:08:31 18:17:05";
    DateTimeOriginal = "2017:08:31 18:17:05";
    ExposureBiasValue = 0;
    ExposureMode = 0;
    ExposureProgram = 2;
    ExposureTime = "0.06666666666666667";
    FNumber = "2.2";
    Flash = 24;
    FocalLenIn35mmFilm = 29;
    FocalLength = "4.15";
    ISOSpeedRatings =     (
        500
    );
    LensMake = Apple;
    LensModel = "iPhone SE back camera 4.15mm f/2.2";
    LensSpecification =     (
        "4.15",
        "4.15",
        "2.2",
        "2.2"
    );
    MeteringMode = 5;
    PixelXDimension = 4032;
    PixelYDimension = 3024;
    SceneType = 1;
    SensingMethod = 2;
    ShutterSpeedValue = "3.906969875959835";
    SubjectArea =     (
        2015,
        1511,
        2217,
        1330
    );
    SubsecTimeDigitized = 980;
    SubsecTimeOriginal = 980;
    WhiteBalance = 0;
};
"PixelHeight" = 3024;
"{GPS}" = {
    Altitude = 111;
    AltitudeRef = 0;
    DateStamp = "2017:08:31";
    ImgDirection = 0;
    ImgDirectionRef = T;
    Latitude = "40.33291333333333";
    LatitudeRef = N;
    Longitude = 0;
    LongitudeRef = W;
    Speed = 0;
    SpeedRef = K;
    TimeStamp = "10:17:03";
};
"{JFIF}" = {
    DensityUnit = 0;
    JFIFVersion =     (
        1,
        0,
        1
    );
    XDensity = 72;
    YDensity = 72;
};
"ProfileName" = "sRGB IEC61966-2.1";
"DPIWidth" = 72;
"DPIHeight" = 72;
"ColorModel" = "RGB";
"Orientation" = 6;
"Depth" = 8;
AnthonyOSX
  • 342
  • 5
  • 15
  • Why was this question marked as a duplicate? The duplicate question shows NO GPS data being available while in my case some is clearly returned. – AnthonyOSX Sep 01 '17 at 16:23

1 Answers1

0

According to other answers you must retrieve location data yourself, by first retrieving it from CLLocation. If you need it to be included in the image's EXIF data, you can then add it yourself.

Navillus
  • 307
  • 1
  • 9
  • The GPS data is clearly there, albeit having an incorrect longitude. My question is, why is the latitude/altitude being added properly but not the longitude? – AnthonyOSX Sep 01 '17 at 16:24
  • I believe the point is that regardless of what is there, documentation suggests that GPS data should not be there at all. If you are asking this for academic reasons then you may have to look into it your self, but for the sake of writing a program, you should treat that data as an undocumented side effect and ignore it. It would help if you were able to provide the code you use to access the EXIF data because there are multiple ways to do it. – Navillus Sep 01 '17 at 16:46