目录
获取经纬度和高度
import exifread
def get_gps_exifread(image_path):
with open(image_path, 'rb') as f:
tags = exifread.process_file(f)
for tag in tags.keys():
if tag.startswith('GPS'):
print(f"{tag}: {tags[tag]}")
# 使用示例
image_path = r"E:\data\mouse_hole\草滩区域二航高30\h\18h00002.JPG"
get_gps_exifread(image_path)
获取经度 纬度
import exifread
def get_gps_coordinates(image_path):
""" 从图像文件中提取 GPS 坐标 """
with open(image_path, 'rb') as f:
tags = exifread.process_file(f)
lat_tag = tags.get('GPS GPSLatitude')
lat_ref_t