Exif数据没有为地理位置提供信息

时间:2015-08-27 20:53:30

标签: python geolocation exif

我正在尝试从图像中获取地理位置,以显示它在哪里拍摄。 我正在使用exifread libriary和这个函数:

def info(image):
    f = open(image, 'rb')
    tags = dict(exifread.process_file(f))
    for tag in tags.keys():
        if "GPS" in tag:
            print "Key: %s, value %s" % (tag, tags[tag])
    return

它返回给我这个信息:

Key: GPS GPSLatitudeRef, value N
Key: GPS GPSLatitude, value [42, 51, 28]
Key: GPS GPSProcessingMethod, value [65, 83, 67, 73, 73, 0, 0, 0, 71, 80, 83]
Key: GPS GPSDate, value 2015:08:18
Key: GPS GPSVersionID, value [2, 2, 0, 0]
Key: Image GPSInfo, value 722
Key: GPS GPSAltitudeRef, value 0
Key: GPS GPSTimeStamp, value [17, 42, 7]
Key: GPS GPSLongitude, value [74, 19, 35]
Key: GPS GPSLongitudeRef, value E
Key: GPS GPSAltitude, value 694

我使用GPSLatitude(42.5128)和GPSLongitude(74.1935)作为坐标,但精度非常低,因为逗号后只有4个数字。 我该怎么做才能获得更准确的结果?

2 个答案:

答案 0 :(得分:0)

假设位置是由消费级(非军用)装备确定的,没有其他类型的修正,小数点后4位就像你能够得到的那样准确。

一些有用的链接:

答案 1 :(得分:0)

Exif使用有理数存储纬度/经度数据。即A/B。您正在使用的库正在将它们转换为HMS,并可能丢失一些信息。通过另一个Exif查看器运行图像来检查是否是这种情况,理想情况是读取原始合理值。然后,您可以了解图像的元数据是否比从exifread获得的更精确。

相关问题