我正在开发一个iPhone应用程序,它将从拍摄的照片中提取GPS数据.我已经为这个功能做了很好的工作,但我注意到返回的GPS数据没有显示正确的+
或-
坐标值.例如,我在日志中获得此输出:
"{GPS}" = { Altitude = "33.0329"; DOP = 65; Latitude = "64.84069"; LatitudeRef = N; Longitude = "32.41367"; LongitudeRef = W; TimeStamp = "2014:01:04 14:47:01"; };
当我使用纬度和经度并使用反向地理定位映射时,我会在世界的另一边找到一些位置.在调查之后,我看到了价值:
Longitude = "32.41367";
应该:
Longitude = "-32.41367";
它只是错过了消极的.关于为什么会发生这种情况的任何想法?以下是构建上述输出的一些代码示例:
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *jpeg = UIImageJPEGRepresentation(image,image.scale); CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)jpeg, NULL); NSDictionary *metadata = (__bridge NSDictionary *)CGImageSourceCopyPropertiesAtIndex(source,0,NULL); NSMutableDictionary *mutableMetadata = [metadata mutableCopy]; [mutableMetadata setLocation:self.currentLocation]; CFStringRef UTI = CGImageSourceGetType(source); NSMutableData *data = [NSMutableData data]; CGImageDestinationRef destination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef) data, UTI, 1, NULL); CGImageDestinationAddImageFromSource(destination,source, 0, (__bridge CFDictionaryRef) mutableMetadata); BOOL success = CGImageDestinationFinalize(destination); NSLog(@"This is the log value that was referenced above: %@",mutableMetadata);
Martijn.. 5
N和E具有正值S和W具有负值
但是,如果您只是将参考文献放在坐标中,Google地图就知道如何映射它们.例如,在Google地图(50.53467,-100.45646)中等于N50.53467W100.45646
N和E具有正值S和W具有负值
但是,如果您只是将参考文献放在坐标中,Google地图就知道如何映射它们.例如,在Google地图(50.53467,-100.45646)中等于N50.53467W100.45646